Documentation ¶
Index ¶
- func ConstructResourceName(datastore, name string) string
- func DistinctDirectory(directories []string) []string
- func GetValidJobDirectory(directories []string) []string
- func GetValidResourceDirectory(directories []string) []string
- type DirectoryParser
- type Getter
- type JobPlan
- type Kind
- type KindList
- type ListByNamespace
- func (p *ListByNamespace[Kind]) Append(namespace string, newPlan Kind)
- func (p ListByNamespace[Kind]) DeletePlansByNames(names ...string) ListByNamespace[Kind]
- func (p *ListByNamespace[Kind]) GetAll() []Kind
- func (p *ListByNamespace[Kind]) GetAllNamespaces() []string
- func (p *ListByNamespace[Kind]) GetByNamespace(namespace string) []Kind
- func (p *ListByNamespace[Kind]) GetPlansByNamespaceName() map[string][]string
- func (p *ListByNamespace[Kind]) IsZero() bool
- type OperationByNamespaces
- type Plan
- type ResourcePlan
- func (ResourcePlan) FileSuffix() string
- func (p ResourcePlan) GetName() string
- func (p ResourcePlan) ParseDirectory(directory string) string
- func (p *ResourcePlan) SetName(name string)
- func (p *ResourcePlan) SetOldNamespace(oldNamespace string)
- func (p ResourcePlan) ValidDirectory(directory string) bool
- type Setter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructResourceName ¶ added in v0.14.3
func DistinctDirectory ¶
func GetValidJobDirectory ¶
Types ¶
type DirectoryParser ¶
type JobPlan ¶
func (JobPlan) FileSuffix ¶
func (JobPlan) ParseDirectory ¶
func (*JobPlan) SetOldNamespace ¶
func (JobPlan) ValidDirectory ¶
type ListByNamespace ¶
func NewListByNamespace ¶
func NewListByNamespace[kind Kind]() ListByNamespace[kind]
func (*ListByNamespace[Kind]) Append ¶
func (p *ListByNamespace[Kind]) Append(namespace string, newPlan Kind)
func (ListByNamespace[Kind]) DeletePlansByNames ¶
func (p ListByNamespace[Kind]) DeletePlansByNames(names ...string) ListByNamespace[Kind]
func (*ListByNamespace[Kind]) GetAll ¶
func (p *ListByNamespace[Kind]) GetAll() []Kind
func (*ListByNamespace[Kind]) GetAllNamespaces ¶
func (p *ListByNamespace[Kind]) GetAllNamespaces() []string
func (*ListByNamespace[Kind]) GetByNamespace ¶
func (p *ListByNamespace[Kind]) GetByNamespace(namespace string) []Kind
func (*ListByNamespace[Kind]) GetPlansByNamespaceName ¶
func (p *ListByNamespace[Kind]) GetPlansByNamespaceName() map[string][]string
func (*ListByNamespace[Kind]) IsZero ¶
func (p *ListByNamespace[Kind]) IsZero() bool
type OperationByNamespaces ¶
type OperationByNamespaces[kind Kind] struct { Create ListByNamespace[kind] `json:"create"` Delete ListByNamespace[kind] `json:"delete"` Update ListByNamespace[kind] `json:"update"` Migrate ListByNamespace[kind] `json:"migrate"` }
func NewOperationByNamespace ¶
func NewOperationByNamespace[T Kind]() OperationByNamespaces[T]
func (*OperationByNamespaces[Kind]) Add ¶
func (o *OperationByNamespaces[Kind]) Add(namespace, sourceName, targetName string, plan Kind)
Add will decide where to add the plan, sourceName: latest state, targetName: current state
func (OperationByNamespaces[kind]) GetAllNamespaces ¶
func (o OperationByNamespaces[kind]) GetAllNamespaces() []string
func (OperationByNamespaces[Kind]) IsZero ¶
func (o OperationByNamespaces[Kind]) IsZero() bool
type Plan ¶
type Plan struct { ProjectName string `json:"project_name"` Job OperationByNamespaces[*JobPlan] `json:"job"` Resource OperationByNamespaces[*ResourcePlan] `json:"resource"` }
func (Plan) SameProjectName ¶
type ResourcePlan ¶
type ResourcePlan struct { Name string `json:"name"` Datastore string `json:"datastore"` OldNamespace *string `json:"old_namespace"` // OldNamespace will be used on migrate operation }
func (ResourcePlan) FileSuffix ¶
func (ResourcePlan) FileSuffix() string
func (ResourcePlan) GetName ¶
func (p ResourcePlan) GetName() string
func (ResourcePlan) ParseDirectory ¶
func (p ResourcePlan) ParseDirectory(directory string) string
func (*ResourcePlan) SetName ¶
func (p *ResourcePlan) SetName(name string)
func (*ResourcePlan) SetOldNamespace ¶
func (p *ResourcePlan) SetOldNamespace(oldNamespace string)
func (ResourcePlan) ValidDirectory ¶
func (p ResourcePlan) ValidDirectory(directory string) bool
Click to show internal directories.
Click to hide internal directories.