stack

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

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"
)

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(Unknown | Drifted | Failed | Canceled | Unrecognized)
	// AllFilter filters for any stacks statuses.
	AllFilter FilterStatus = FilterStatus(OK) | UnhealthyFilter
	// NoFilter disables the filtering for statuses.
	NoFilter FilterStatus = 0
)

func NewStatusFilter

func NewStatusFilter(str string) FilterStatus

NewStatusFilter creates a new filter for stack statuses.

func (FilterStatus) String

func (f FilterStatus) String() string

func (FilterStatus) Validate

func (f FilterStatus) Validate() error

Validate the status filter.

type Status

type Status uint8

Status of a stack.

const (
	OK           Status = 1 << iota // OK status is used when the stack ran successfully.
	Unknown                         // Unknown status is used for newly created stacks, which never ran.
	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.
	Canceled                        // Canceled indicates the deployment of the stack was canceled.
	Unrecognized                    // Unrecognized indicates any status returned from TMC but still not recognized by the client.

)

func NewStatus

func NewStatus(str string) Status

NewStatus creates a new stack status from a string.

func (Status) MarshalJSON

func (s Status) MarshalJSON() ([]byte, error)

MarshalJSON implements the Marshaller interface.

func (Status) String

func (s Status) String() string

String representation of the status.

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals stack status from JSONs.

func (Status) Validate

func (s Status) Validate() error

Validate the status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL