namespace.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package model
  2. // PostSyncActionType defines the type of action after synchronization
  3. const (
  4. // PostSyncActionNone indicates no operation after sync
  5. PostSyncActionNone = "none"
  6. // PostSyncActionReloadNginx indicates reload Nginx after sync
  7. PostSyncActionReloadNginx = "reload_nginx"
  8. )
  9. // UpstreamTestType defines the type of upstream test
  10. const (
  11. // UpstreamTestLocal indicates local upstream test
  12. UpstreamTestLocal = "local"
  13. // UpstreamTestRemote indicates remote upstream test
  14. UpstreamTestRemote = "remote"
  15. // UpstreamTestMirror indicates mirror upstream test
  16. UpstreamTestMirror = "mirror"
  17. )
  18. // DeployMode defines where configs should be deployed
  19. const (
  20. // DeployModeLocal indicates deploy locally with optional remote sync
  21. DeployModeLocal = "local"
  22. // DeployModeRemote indicates deploy to remote nodes only
  23. DeployModeRemote = "remote"
  24. )
  25. // Namespace represents a group of environments that can be synced across nodes
  26. type Namespace struct {
  27. Model
  28. Name string `json:"name"`
  29. SyncNodeIds []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
  30. OrderID int `json:"-" gorm:"default:0"`
  31. PostSyncAction string `json:"post_sync_action" gorm:"default:'reload_nginx'"`
  32. UpstreamTestType string `json:"upstream_test_type" gorm:"default:'local'"`
  33. DeployMode string `json:"deploy_mode" gorm:"default:'local'"`
  34. }