Documentation ¶
Overview ¶
Package drift provides types and helpers for cloud drifts.
Index ¶
Constants ¶
View Source
const ( // ErrInvalidStatus represents an invalid drift status error. ErrInvalidStatus errors.Kind = "invalid drift status" // ErrInvalidFilterStatus represents an invalid drift status filter error. ErrInvalidFilterStatus errors.Kind = "invalid drift stack filter" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterStatus ¶ added in v0.9.1
type FilterStatus Status
FilterStatus represents a filter for drift statuses.
const ( // UnhealthyFilter status is used for filtering not OK drift status. UnhealthyFilter FilterStatus = FilterStatus(^OK) // HealthyFilter status is used for filtering for healthy statuses. Just [OK] for now. HealthyFilter FilterStatus = FilterStatus(OK) // NoFilter disables the filtering for statuses. NoFilter FilterStatus = 0 )
func NewStatusFilter ¶ added in v0.9.1
func NewStatusFilter(str string) (FilterStatus, error)
NewStatusFilter creates a new filter for drift statuses.
func (FilterStatus) Is ¶ added in v0.9.1
func (f FilterStatus) Is(status Status) bool
Is tells if the filter matches the provided status.
func (FilterStatus) String ¶ added in v0.9.1
func (f FilterStatus) String() string
type Status ¶
type Status uint8
Status of a drift.
const ( OK Status = 1 << iota // OK status is used when the stack is not drifted. Unknown // Unknown indicates the drift detection was not executed yet. Drifted // Drifted status indicates the stack is drifted. Failed // Failed status indicates the drift detection of the stack failed. Unrecognized // Unrecognized indicates any drift status returned from TMC but not recognized by this client version. )
func (Status) Is ¶ added in v0.9.1
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 drift status from JSONs.
Click to show internal directories.
Click to hide internal directories.