Documentation
¶
Index ¶
- Constants
- type Action
- type Manager
- type Phase
- type SpecAction
- type State
- type StateManager
- type StateResource
- type Status
- type StatusConditions
- func (sc *StatusConditions) GetGot() string
- func (sc *StatusConditions) GetMessage() string
- func (sc *StatusConditions) GetReason() Action
- func (sc *StatusConditions) GetReasonString() string
- func (sc *StatusConditions) GetStatus() Phase
- func (sc *StatusConditions) GetStatusString() string
- func (sc *StatusConditions) GetType() SpecAction
- func (sc *StatusConditions) GetTypeString() string
- func (sc *StatusConditions) GetWant() string
- func (sc *StatusConditions) SetMessage(message string)
Constants ¶
const ( // Pending means the declared changes have yet to be made. Pending Phase = "Pending" // Succeeded means the declared changes have been made. Succeeded Phase = "Succeeded" // Failed means the declaared changes have not been made. Failed Phase = "Failed" // Unknown means that for some reason the state of the resource // could not be obtained. Unknown Phase = "Unknown" // NoOp means no changes will be made, resource matches declared state. NoOp Phase = "NoOp" // Plan represents the changes to make consistent with the desired state. Plan Action = "Plan" // Apply represents the changes to make the desired state. Apply Action = "Apply" )
These are the valid statuses of the resource.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { Reconcile() error GetStatus() Phase GetStatusString() string GetStatusConditions() []StatusConditions SetStatusCondition( statusType SpecAction, status Phase, message string, got string, want string, ) GetState() *StateResource }
Manager interface to files.
type Phase ¶
type Phase string
Phase is a label for the condition of the resource at the current time.
type State ¶
type State struct { Items []*StateResource `json:"items,omitempty"` FileName string `json:"-"` // contains filtered or unexported fields }
State used by state file and status.
func NewState ¶
func NewState( fileManager internal.FileManager, stateFile string, ) *State
NewState create a new instance of State.
func (*State) GetItems ¶
func (s *State) GetItems() []*StateResource
GetItems get the items property.
func (*State) GetStatusString ¶
GetStatusString the status property as a string.
func (*State) SetItems ¶
func (s *State) SetItems( stateResource *StateResource, )
SetItems set the items property.
type StateManager ¶
type StateManager interface { GetStatus() Phase GetStatusString() string GetItems() []*StateResource SetItems(stateResource *StateResource) SetState() error GetState() (*State, error) }
StateManager interface to state.
type StateResource ¶
type StateResource struct { Name string `json:"name"` Kind string `json:"kind"` APIVersion string `json:"apiVersion"` Phase Phase `json:"phase,omitempty"` Status *Status `json:"status"` }
StateResource container holding resource state.
func (*StateResource) GetStatus ¶
func (r *StateResource) GetStatus() Phase
GetStatus the status property.
type Status ¶
type Status struct { // Phase sets `phase` as .status.Phase of the resource. Phase Phase `json:"phase,omitempty"` // A human readable message indicating details about the transition. Message string `json:"message,omitempty"` // The reason for the condition's last transition. Reason string `json:"reason,omitempty"` // Conditions contains status of the File lifecycle. Conditions []StatusConditions `json:"conditions,omitempty"` }
Status contains status of the resource.
type StatusConditions ¶
type StatusConditions struct { // Type the resources condition type. Type SpecAction `json:"type,omitempty"` // Status the resources phase. Status Phase `json:"status,omitempty"` // A human readable message indicating details about the transition. Message string `json:"message,omitempty"` // The reason for the condition's last transition. Reason Action `json:"reason,omitempty"` // Got the resources current state. Got string `json:"got,omitempty"` // Want the resources desired state. Want string `json:"want,omitempty"` }
StatusConditions contains status of the resource lifecycle.
func (*StatusConditions) GetGot ¶
func (sc *StatusConditions) GetGot() string
GetGot get the got property.
func (*StatusConditions) GetMessage ¶
func (sc *StatusConditions) GetMessage() string
GetMessage get the message property.
func (*StatusConditions) GetReason ¶
func (sc *StatusConditions) GetReason() Action
GetReason the reason property.
func (*StatusConditions) GetReasonString ¶
func (sc *StatusConditions) GetReasonString() string
GetReasonString the reason property.
func (*StatusConditions) GetStatus ¶
func (sc *StatusConditions) GetStatus() Phase
GetStatus the status property.
func (*StatusConditions) GetStatusString ¶
func (sc *StatusConditions) GetStatusString() string
GetStatusString the status property as a string.
func (*StatusConditions) GetType ¶
func (sc *StatusConditions) GetType() SpecAction
GetType the action property.
func (*StatusConditions) GetTypeString ¶
func (sc *StatusConditions) GetTypeString() string
GetTypeString the action property.
func (*StatusConditions) GetWant ¶
func (sc *StatusConditions) GetWant() string
GetWant get the want property.
func (*StatusConditions) SetMessage ¶
func (sc *StatusConditions) SetMessage(message string)
SetMessage set the message property.