Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CreateAction is the ReconcileAction used when a target object did not exist in the current state and was created. CreateAction = ReconcileAction("create") // UpdateAction is the ReconcileAction used when a target object exists in the current state and was updated. UpdateAction = ReconcileAction("update") // DeleteAction is the ReconcileAction used when a current object exists in the target state and was deleted. DeleteAction = ReconcileAction("delete") )
Variables ¶
This section is empty.
Functions ¶
func MaskEnvVarValue ¶
Types ¶
type Entity ¶ added in v1.10.0
type Entity struct {
// Name is the name of the entity.
Name string `json:"name"`
// Kind is the type of entity.
Kind string `json:"kind"`
// Old is the original entity in the current state, if any.
Old any `json:"old,omitempty"`
// New is the new entity in the target state, if any.
New any `json:"new,omitempty"`
}
Entity is an entity processed by the diff engine.
type EntityAction ¶ added in v1.10.0
type EntityAction struct {
// Action is the ReconcileAction taken on the entity.
Action ReconcileAction `json:"action"`
// Entity holds the processed entity.
Entity Entity `json:"entity"`
// Diff is diff string describing the modifications made to an entity.
Diff string `json:"-"`
// Error is the error encountered processing and entity, if any.
Error error `json:"error,omitempty"`
}
EntityAction describes an entity processed by the diff engine and the action taken on it.
type EntityChanges ¶
type EntityChanges struct {
Creating []EntityState `json:"creating"`
Updating []EntityState `json:"updating"`
Deleting []EntityState `json:"deleting"`
}
type EntityState ¶
type JSONOutputObject ¶
type JSONOutputObject struct {
Changes EntityChanges `json:"changes"`
Summary Summary `json:"summary"`
Warnings []string `json:"warnings"`
Errors []string `json:"errors"`
}
type ReconcileAction ¶ added in v1.10.0
type ReconcileAction string
ReconcileAction is an action taken by the diff engine.
type Stats ¶
type Stats struct {
CreateOps *utils.AtomicInt32Counter
UpdateOps *utils.AtomicInt32Counter
DeleteOps *utils.AtomicInt32Counter
}
Stats holds the stats related to a Solve.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer takes in a current and target state of Kong, diffs them, generating a Graph to get Kong from current to target state.
func (*Syncer) GetResultChan ¶ added in v1.10.0
func (sc *Syncer) GetResultChan() chan EntityAction
GetResultChan returns the Syncer's result channel.
type SyncerOpts ¶
type SyncerOpts struct {
CurrentState *state.KongState
TargetState *state.KongState
KongClient *kong.Client
KonnectClient *konnect.Client
SilenceWarnings bool
StageDelaySec int
NoMaskValues bool
IncludeLicenses bool
IsKonnect bool
CreatePrintln func(a ...interface{})
UpdatePrintln func(a ...interface{})
DeletePrintln func(a ...interface{})
// EnableEntityActions instructs the Syncer to send EntityActions to its resultChan. If enabled, clients must
// consume the Syncer.resultChan channel or Syncer.Solve() will block.
EnableEntityActions bool
// Prevents the Syncer from performing any Delete operations. Default is false (will delete).
NoDeletes bool
}
Click to show internal directories.
Click to hide internal directories.