Documentation ¶
Overview ¶
Package stack provides types and helpers for cloud stacks.
Index ¶
Constants ¶
View Source
const ( // ErrInvalidStatus represents an invalid stack status error. ErrInvalidStatus errors.Kind = "invalid stack status" // ErrInvalidFilterStatus represents an invalid filter stack status error. ErrInvalidFilterStatus errors.Kind = "invalid filter stack status" )
View Source
const AnyTarget = ""
AnyTarget is the empty deployment target filter that includes any target.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterStatus ¶
type FilterStatus Status
FilterStatus represents a filter for stack statuses.
const ( // UnhealthyFilter status is used for filtering not Ok status. UnhealthyFilter FilterStatus = FilterStatus(Drifted | Failed) // HealthyFilter status is used for filtering healthy statuses. Just [OK] for now. HealthyFilter FilterStatus = FilterStatus(OK) // AllFilter filters for any stacks statuses. AllFilter FilterStatus = HealthyFilter | UnhealthyFilter // NoFilter disables the filtering for statuses. NoFilter FilterStatus = 0 )
func NewStatusFilter ¶
func NewStatusFilter(str string) (FilterStatus, error)
NewStatusFilter creates a new filter for stack statuses.
func (FilterStatus) Is ¶ added in v0.4.4
func (f FilterStatus) Is(status Status) bool
Is tells if the filter matches the provided status.
func (FilterStatus) String ¶
func (f FilterStatus) String() string
type Status ¶
type Status uint8
Status of a stack.
const ( OK Status = 1 << iota // OK status is used when the stack ran successfully. Drifted // Drifted status is used when a stack definition is different from that of the current status. Failed // Failed status indicates the deployment of the stack failed. Unrecognized // Unrecognized indicates any status returned from TMC but still not recognized by the client. )
func (Status) Is ¶ added in v0.4.4
func (s Status) Is(filter FilterStatus) bool
Is tells if status matches the provided filter.
func (Status) MarshalJSON ¶
MarshalJSON implements the Marshaller interface.
func (*Status) UnmarshalJSON ¶
UnmarshalJSON unmarshals stack status from JSONs.
Click to show internal directories.
Click to hide internal directories.