bifrost

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryLocker

type InMemoryLocker struct {
	// contains filtered or unexported fields
}

func NewInMemoryLocker

func NewInMemoryLocker() *InMemoryLocker

func (*InMemoryLocker) GetLockByNamespace

func (l *InMemoryLocker) GetLockByNamespace(namespace string) []*Lock

func (*InMemoryLocker) GetLockByPath

func (l *InMemoryLocker) GetLockByPath(namespace string, lockPath string) *Lock

func (*InMemoryLocker) GrabLock

func (l *InMemoryLocker) GrabLock(namespace string, lockPath string, uuid string, reason string) (bool, error)

func (*InMemoryLocker) ReleaseLock

func (l *InMemoryLocker) ReleaseLock(namespace string, lockPath string, uuid string) error

type Lock

type Lock struct {
	// contains filtered or unexported fields
}

type Locker

type Locker interface {
	GrabLock(namespace string, lockPath string, uuid string, reason string) (bool, error)
	ReleaseLock(namespace string, lockPath string, uuid string) error
}

type Release

type Release struct {
	AwsAccountID *string `json:"aws_account_id,omitempty"`
	AwsRegion    *string `json:"aws_region,omitempty"`

	ReleaseSHA256 string `json:"-"` // Not Set By Client, Not Marshalled

	UUID      *string `json:"uuid,omitempty"`       // Generated By server
	ReleaseID *string `json:"release_id,omitempty"` // Generated Client

	ProjectName *string `json:"project_name,omitempty"`
	ConfigName  *string `json:"config_name,omitempty"`
	Bucket      *string `json:"bucket,omitempty"` // Bucket with Additional Data in it

	CreatedAt *time.Time `json:"created_at,omitempty"`
	StartedAt *time.Time `json:"started_at,omitempty"`

	Timeout *int `json:"timeout,omitempty"` // How long should we try and deploy in seconds

	// Additional Metadata attached but should not be functional
	Metadata map[string]string `json:"metadata,omitempty"`

	Error   *ReleaseError `json:"error,omitempty"`
	Success *bool         `json:"success,omitempty"`
}

Release is the Data Structure passed between Client and Deployer

func (*Release) AppendLog

func (release *Release) AppendLog(s3c aws.S3API, log string) error

func (*Release) CheckUserLock

func (r *Release) CheckUserLock(s3c aws.S3API, lockPath string) error

func (*Release) ErrorPrefix

func (r *Release) ErrorPrefix() string

func (*Release) ExecutionName

func (r *Release) ExecutionName() *string

ExecutionName returns

func (*Release) ExecutionPrefix

func (r *Release) ExecutionPrefix() string

ExecutionPrefix returns

func (*Release) GrabLocks

func (r *Release) GrabLocks(s3c aws.S3API, locker Locker, lockTableName string) error

GrabLock retrieves the Lock returns LockExistsError, or LockError

func (*Release) GrabReleaseLock

func (r *Release) GrabReleaseLock(s3c aws.S3API) error

func (*Release) GrabRootLock

func (r *Release) GrabRootLock(s3c aws.S3API, locker Locker, lockTableName string) error

func (*Release) Halt

func (r *Release) Halt(s3c aws.S3API, message *string) error

Halt writes Halt flag to S3 to attempt to stop the release

func (*Release) HaltPath

func (r *Release) HaltPath() *string

func (*Release) IsHalt

func (r *Release) IsHalt(s3c aws.S3API) error

IsHalt will error with if halt flag found

func (*Release) LogPath

func (release *Release) LogPath() *string

func (*Release) ProjectDir

func (r *Release) ProjectDir() *string

func (*Release) ReleaseDir

func (r *Release) ReleaseDir() *string

func (*Release) ReleaseLockPath

func (r *Release) ReleaseLockPath() *string

func (*Release) ReleasePath

func (r *Release) ReleasePath() *string

func (*Release) RemoveHalt

func (r *Release) RemoveHalt(s3c aws.S3API)

RemoveHalt deletes the halt flat from S3

func (*Release) RootDir

func (r *Release) RootDir() *string

func (*Release) RootLockPath

func (r *Release) RootLockPath() *string

func (*Release) SetDefaults

func (r *Release) SetDefaults(region *string, account *string, bucket_prefix string)

SetDefaults is passed the region and account where the lambda is executed AND the default-bucket-prefix to calculate the default bucket name.

func (*Release) SharedProjectDir

func (r *Release) SharedProjectDir() *string

func (*Release) TimedOut

func (r *Release) TimedOut() error

func (*Release) UnlockRoot

func (r *Release) UnlockRoot(s3c aws.S3API, locker Locker, lockTableName string) error

UnlockRootLock deletes the Lock File for the release

func (*Release) UserLockPath

func (r *Release) UserLockPath() *string

func (*Release) Validate

func (r *Release) Validate(s3c aws.S3API, cRelease interface{}) error

Validate checks 1. the attributes are assigned 2. the time frame of created at is valid 3. the uploaded release sha is correct (requires S3 and &Release{})

func (*Release) WipeControlledValues

func (r *Release) WipeControlledValues()

This is called initially to wipe values that are controlled by this release

func (*Release) WriteLog

func (release *Release) WriteLog(s3c aws.S3API, log string) error

type ReleaseError

type ReleaseError struct {
	Error *string
	Cause *string
}

ReleaseError contains the error and cause for the state machine

Jump to

Keyboard shortcuts

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