Documentation ¶
Index ¶
- Constants
- func PlanActionFromDiff(diff []*Diff) []*apiv1.PlanAction
- type Diff
- func (d *Diff) Applied() bool
- func (d *Diff) AppliedSteps() int
- func (d *Diff) IsApplied(steps int) bool
- func (d *Diff) MarkStepAsApplied()
- func (d *Diff) ObjectType() string
- func (d *Diff) RequiredSteps() int
- func (d *Diff) SetApplied(step int)
- func (d *Diff) ToApplyAction(step, total int) *apiv1.ApplyAction
- func (d *Diff) ToPlanAction() *apiv1.PlanAction
- func (d *Diff) Wait(steps int)
- func (d *Diff) WaitContext(ctx context.Context, steps int) error
- type DiffType
- type FieldInfo
- type FieldProperties
- type FieldTypeInfo
- type Options
- type Registry
- func (r *Registry) Apply(ctx context.Context, meta interface{}, diff []*Diff, ...) error
- func (r *Registry) DeregisterAppResource(app *apiv1.App, id string, o Resource) error
- func (r *Registry) DeregisterDependencyResource(dep *apiv1.Dependency, id string, o Resource) error
- func (r *Registry) DeregisterPluginResource(scope, id string, o Resource) error
- func (r *Registry) Diff(ctx context.Context, meta interface{}) ([]*Diff, error)
- func (r *Registry) Dump() ([]byte, error)
- func (r *Registry) GetAppResource(app *apiv1.App, id string, o Resource) (ok bool)
- func (r *Registry) GetDependencyResource(dep *apiv1.Dependency, id string, o Resource) (ok bool)
- func (r *Registry) GetFieldDependencies(f fields.Field) []*ResourceWrapper
- func (r *Registry) GetPluginResource(scope, id string, o Resource) (ok bool)
- func (r *Registry) Load(state []byte) error
- func (r *Registry) Partition(p string) *Registry
- func (r *Registry) Process(ctx context.Context, meta interface{}) error
- func (r *Registry) ProcessAndDiff(ctx context.Context, meta interface{}) ([]*Diff, error)
- func (r *Registry) RegisterAppResource(app *apiv1.App, id string, o Resource) (added bool, err error)
- func (r *Registry) RegisterDependencyResource(dep *apiv1.Dependency, id string, o Resource) (added bool, err error)
- func (r *Registry) RegisterPluginResource(scope, id string, o Resource) (added bool, err error)
- func (r *Registry) RegisterType(o Resource)
- func (r *Registry) SkipAppResources(app *apiv1.App)
- type Resource
- type ResourceBase
- func (b *ResourceBase) Diff() *Diff
- func (b *ResourceBase) IsDeleted() bool
- func (b *ResourceBase) IsExisting() bool
- func (b *ResourceBase) IsNew() bool
- func (b *ResourceBase) IsRegistered() bool
- func (b *ResourceBase) Lock(k string)
- func (b *ResourceBase) MarkAsDeleted()
- func (b *ResourceBase) MarkAsExisting()
- func (b *ResourceBase) MarkAsNew()
- func (b *ResourceBase) Registry() *Registry
- func (b *ResourceBase) SetState(v ResourceState)
- func (b *ResourceBase) SkipState() bool
- func (b *ResourceBase) State() ResourceState
- func (b *ResourceBase) Unlock(k string)
- func (b *ResourceBase) Wrapper() *ResourceWrapper
- type ResourceBeforeDiffHook
- type ResourceCUD
- type ResourceCriticalChecker
- type ResourceDiffCalculator
- type ResourceID
- type ResourceIniter
- type ResourceProcessor
- type ResourceReader
- type ResourceReference
- type ResourceSerialized
- type ResourceState
- type ResourceTypeInfo
- type ResourceTypeVerbose
- type ResourceWrapper
- func (w *ResourceWrapper) FieldList() []string
- func (w *ResourceWrapper) MarkAllWantedAsCurrent()
- func (w *ResourceWrapper) MarshalJSON() ([]byte, error)
- func (w *ResourceWrapper) SetFieldValues(props map[string]interface{}) error
- func (w *ResourceWrapper) String() string
- func (w *ResourceWrapper) UnsetAllCurrent()
Constants ¶
View Source
const ( SourceApp = "app" SourceDependency = "dependency" SourcePlugin = "plugin" )
Variables ¶
This section is empty.
Functions ¶
func PlanActionFromDiff ¶
func PlanActionFromDiff(diff []*Diff) []*apiv1.PlanAction
Types ¶
type Diff ¶
type Diff struct { Object *ResourceWrapper Type DiffType Fields []string Critical bool // contains filtered or unexported fields }
func (*Diff) AppliedSteps ¶
func (*Diff) MarkStepAsApplied ¶
func (d *Diff) MarkStepAsApplied()
func (*Diff) ObjectType ¶
func (*Diff) RequiredSteps ¶
func (*Diff) SetApplied ¶
func (*Diff) ToApplyAction ¶
func (d *Diff) ToApplyAction(step, total int) *apiv1.ApplyAction
func (*Diff) ToPlanAction ¶
func (d *Diff) ToPlanAction() *apiv1.PlanAction
type FieldInfo ¶
type FieldInfo struct { Type *FieldTypeInfo Value reflect.Value }
type FieldProperties ¶
type FieldTypeInfo ¶
type FieldTypeInfo struct { ReflectType reflect.StructField Properties *FieldProperties Default string DefaultSet bool }
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func (*Registry) DeregisterAppResource ¶
func (*Registry) DeregisterDependencyResource ¶
func (*Registry) DeregisterPluginResource ¶
func (*Registry) GetAppResource ¶
func (*Registry) GetDependencyResource ¶
func (*Registry) GetFieldDependencies ¶
func (r *Registry) GetFieldDependencies(f fields.Field) []*ResourceWrapper
func (*Registry) GetPluginResource ¶
func (*Registry) ProcessAndDiff ¶
func (*Registry) RegisterAppResource ¶
func (*Registry) RegisterDependencyResource ¶
func (*Registry) RegisterPluginResource ¶
func (*Registry) RegisterType ¶
func (*Registry) SkipAppResources ¶
type Resource ¶
type Resource interface { GetName() string Registry() *Registry Diff() *Diff Wrapper() *ResourceWrapper SetState(ResourceState) State() ResourceState IsRegistered() bool IsNew() bool MarkAsNew() IsExisting() bool MarkAsExisting() IsDeleted() bool MarkAsDeleted() SkipState() bool // contains filtered or unexported methods }
type ResourceBase ¶
type ResourceBase struct {
// contains filtered or unexported fields
}
func (*ResourceBase) Diff ¶
func (b *ResourceBase) Diff() *Diff
func (*ResourceBase) IsDeleted ¶
func (b *ResourceBase) IsDeleted() bool
func (*ResourceBase) IsExisting ¶
func (b *ResourceBase) IsExisting() bool
func (*ResourceBase) IsNew ¶
func (b *ResourceBase) IsNew() bool
func (*ResourceBase) IsRegistered ¶
func (b *ResourceBase) IsRegistered() bool
func (*ResourceBase) Lock ¶
func (b *ResourceBase) Lock(k string)
func (*ResourceBase) MarkAsDeleted ¶
func (b *ResourceBase) MarkAsDeleted()
func (*ResourceBase) MarkAsExisting ¶
func (b *ResourceBase) MarkAsExisting()
func (*ResourceBase) MarkAsNew ¶
func (b *ResourceBase) MarkAsNew()
func (*ResourceBase) Registry ¶
func (b *ResourceBase) Registry() *Registry
func (*ResourceBase) SetState ¶
func (b *ResourceBase) SetState(v ResourceState)
func (*ResourceBase) SkipState ¶
func (b *ResourceBase) SkipState() bool
func (*ResourceBase) State ¶
func (b *ResourceBase) State() ResourceState
func (*ResourceBase) Unlock ¶
func (b *ResourceBase) Unlock(k string)
func (*ResourceBase) Wrapper ¶
func (b *ResourceBase) Wrapper() *ResourceWrapper
type ResourceBeforeDiffHook ¶
type ResourceCUD ¶
type ResourceCriticalChecker ¶
type ResourceDiffCalculator ¶
type ResourceID ¶
type ResourceID struct { ID string `json:"id"` Namespace string `json:"namespace"` Type string `json:"type"` Source string `json:"source"` Partition string `json:"partition,omitempty"` }
func (*ResourceID) Less ¶
func (rid *ResourceID) Less(rid2 *ResourceID) bool
type ResourceIniter ¶
type ResourceProcessor ¶
type ResourceReader ¶
type ResourceReference ¶
type ResourceReference interface {
ReferenceID() string
}
type ResourceSerialized ¶
type ResourceSerialized struct { ResourceID IsNew bool `json:"is_new,omitempty"` ReferenceID string `json:"ref_id,omitempty"` Properties map[string]interface{} `json:"properties,omitempty"` Dependencies []ResourceID `json:"dependencies,omitempty"` DependedBy []ResourceID `json:"depended_by,omitempty"` }
type ResourceState ¶
type ResourceState int
const ( ResourceStateNew ResourceState = iota + 1 ResourceStateExisting ResourceStateDeleted )
type ResourceTypeInfo ¶
type ResourceTypeInfo struct { Type reflect.Type Fields map[string]*FieldTypeInfo }
type ResourceTypeVerbose ¶
type ResourceTypeVerbose interface {
GetType() string
}
type ResourceWrapper ¶
type ResourceWrapper struct { ResourceID Fields map[string]*FieldInfo DependedBy map[*ResourceWrapper]struct{} Dependencies map[*ResourceWrapper]struct{} Resource Resource IsSkipped bool }
func (*ResourceWrapper) FieldList ¶
func (w *ResourceWrapper) FieldList() []string
func (*ResourceWrapper) MarkAllWantedAsCurrent ¶
func (w *ResourceWrapper) MarkAllWantedAsCurrent()
func (*ResourceWrapper) MarshalJSON ¶
func (w *ResourceWrapper) MarshalJSON() ([]byte, error)
func (*ResourceWrapper) SetFieldValues ¶
func (w *ResourceWrapper) SetFieldValues(props map[string]interface{}) error
func (*ResourceWrapper) String ¶
func (w *ResourceWrapper) String() string
func (*ResourceWrapper) UnsetAllCurrent ¶
func (w *ResourceWrapper) UnsetAllCurrent()
Click to show internal directories.
Click to hide internal directories.