Documentation
¶
Index ¶
- Variables
- func CreateDestroyRelease(storage Storage, project, stack, workspace string) (*v1.Release, error)
- func GetLatestRelease(storage Storage) (*v1.Release, error)
- func GetLatestState(storage Storage) (*v1.State, error)
- func NewApplyRelease(storage Storage, project, stack, workspace string) (*v1.Release, error)
- func UpdateApplyRelease(storage Storage, rel *v1.Release, dryRun bool, relLock *sync.Mutex) error
- func UpdateDestroyRelease(storage Storage, rel *v1.Release) error
- func UpdateReleasePhase(rel *v1.Release, phase v1.ReleasePhase, relLock *sync.Mutex)
- func ValidateRelease(r *v1.Release) error
- func ValidateSpec(spec *v1.Spec) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyRelease = errors.New("empty release") ErrEmptyProject = errors.New("empty project") ErrEmptyWorkspace = errors.New("empty workspace") ErrEmptyRevision = errors.New("empty revision") ErrEmptyStack = errors.New("empty stack") ErrEmptySpec = errors.New("empty spec") ErrEmptyState = errors.New("empty state") ErrEmptyPhase = errors.New("empty phase") ErrEmptyCreateTime = errors.New("empty create time") ErrEmptyModifiedTime = errors.New("empty modified time") ErrDuplicateResourceKey = errors.New("duplicate resource key") )
Functions ¶
func CreateDestroyRelease ¶
CreateDestroyRelease creates a release object in the storage for destroy operation.
func GetLatestRelease ¶ added in v0.12.1
GetLatestRelease returns the latest release. If no release exists, return nil.
func GetLatestState ¶
GetLatestState returns the latest state. If no release exists, return nil.
func NewApplyRelease ¶
NewApplyRelease news a release object for apply operation, but no creation in the storage.
func UpdateApplyRelease ¶
UpdateApplyRelease updates the release in the storage if dryRun is false. If release phase is failed, only logging with no error return.
func UpdateDestroyRelease ¶
UpdateDestroyRelease updates the release in the storage. If release phase is failed, only logging with no error return.
func UpdateReleasePhase ¶
UpdateReleasePhase updates the release with the specified phase.
func ValidateRelease ¶
func ValidateSpec ¶
Types ¶
type Storage ¶
type Storage interface {
// Get returns a specified Release by Revision.
Get(revision uint64) (*v1.Release, error)
// GetRevisions returns all the Revisions.
GetRevisions() []uint64
// GetStackBoundRevisions returns the Revisions of a specified Stack.
GetStackBoundRevisions(stack string) []uint64
// GetLatestRevision returns the latest State which corresponds to the current infra Resources.
GetLatestRevision() uint64
// Create creates a new Release in the Storage.
Create(release *v1.Release) error
// Update updates an existing Release in the Storage.
Update(release *v1.Release) error
}
Storage is used to provide storage service for multiple Releases of a specified Project and Workspace.