types

package
v0.0.0-...-8b6eea1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const (
	CloudFormationRequestDelete   = "Delete"
	CloudFormationResponseSuccess = "SUCCESS"
	CloudFormationResponseFailed  = "FAILED"

	DynamoDBEventInsert = "INSERT"

	EcsStateRunning  = "RUNNING"
	EcsStateStopped  = "STOPPED"
	EcsFailureReason = "Essential container in task exited"

	EventTypePush = "push"

	GitContextPrep  = "fabrik/0-prep"
	GitRefBranch    = "branch"
	GitRefMaster    = "master"
	GitRefTag       = "tag"
	GitStateError   = "error"
	GitStateFailure = "failure"
	GitStatePending = "pending"
	GitStateSuccess = "success"

	KeyHmac  = "fabrik.github.hmac"
	KeyToken = "fabrik.github.token"

	PipelineStateStarted   = "STARTED"
	PipelineStateResumed   = "RESUMED"
	PipelineStateSucceeded = "SUCCEEDED"
	PipelineStateFailed    = "FAILED"
)

Variables

View Source
var (
	RegexTagRef = regexp.MustCompile(`v[0-9]+\.[0-9]+\.[0-9]+$`)

	RegexCompleted  = regexp.MustCompile(`.*_COMPLETE`)
	RegexInProgress = regexp.MustCompile(`.*_IN_PROGRESS`)
	RegexFailed     = regexp.MustCompile(`.*_FAILED`)
	RegexRollback   = regexp.MustCompile(`.*ROLLBACK.*`)
)

Functions

This section is empty.

Types

type BuildContext

type BuildContext struct {
	PipelineTemplate []byte
	Parameters       []Parameter
}

BuildContext represents the template and parameters required to deploy a pipeline.

type CloudFormationEvent

type CloudFormationEvent struct {
	RequestId             string          `json:"RequestId"`
	StackId               string          `json:"StackId"`
	RequestType           string          `json:"RequestType"`
	ResourceType          string          `json:"ResourceType"`
	LogicalResourceId     string          `json:"LogicalResourceId"`
	PhysicalResourceId    string          `json:"PhysicalResourceId"`
	ResourceProperties    json.RawMessage `json:"ResourceProperties"`
	OldResourceProperties json.RawMessage `json:"OldResourceProperties"`
	ResponseURL           string          `json:"ResponseURL"`
	ServiceToken          string          `json:"ServiceToken"`
}

CloudFormationEvent

type CloudFormationResponse

type CloudFormationResponse struct {
	Status             string `json:"Status"`
	Reason             string `json:"Reason"`
	StackId            string `json:"StackId"`
	RequestId          string `json:"RequestId"`
	LogicalResourceId  string `json:"LogicalResourceId"`
	PhysicalResourceId string `json:"PhysicalResourceId"`
}

CloudFormationResponse

type ECSEvent

type ECSEvent struct {
	Containers []struct {
		Name         string `json:"name"`
		ContainerArn string `json:"containerArn"`
		LastStatus   string `json:"lastStatus"`
	} `json:"containers"`
	StoppedReason string `json:"stoppedReason,omitempty"`
	TaskArn       string `json:"taskArn"`
}

ECSEvent

type GitHubEvent

type GitHubEvent struct {
	Ref        string `json:"ref"`
	Before     string `json:"before"`
	After      string `json:"after"`
	Created    bool   `json:"created"`
	Deleted    bool   `json:"deleted"`
	Repository struct {
		Name  string `json:"name"`
		Owner struct {
			Name string `json:"name"`
		} `json:"owner"`
	} `json:"repository"`
}

GitHubEvent references relevant fields from the push event.

type GitHubStatus

type GitHubStatus struct {
	State       string `json:"state"`
	TargetUrl   string `json:"target_url"`
	Description string `json:"description"`
	Context     string `json:"context"`
}

GitHubStatus stores status context for a particular repo commit hash

type LambdaManager

type LambdaManager interface {
	Invoke(name string, payload interface{}) error
}

type Parameter

type Parameter struct {
	ParameterKey   string `json:"ParameterKey"`
	ParameterValue string `json:"ParameterValue"`
}

Parameter defines a common format for expressing stack parameters.

type ParameterManifest

type ParameterManifest struct {
	Development []Parameter `json:"development"`
	Staging     []Parameter `json:"staging"`
	Production  []Parameter `json:"production"`
}

ParameterManifest defines a common format for expressing a _set_ of stack parameters.

type PipelineManager

type PipelineManager interface {
	GetRepoInfo(name string) (string, string, error)
	GetRevision(execId, name string) (string, error)
	JobSuccess(id string) error
	JobFailure(id, message string) error
}

PipelineManger provides a means of interacting with and querying active CI/CD pipelines.

type PipelineStageDetail

type PipelineStageDetail struct {
	Version     float32 `json:"version"`
	Pipeline    string  `json:"pipeline"`
	ExecutionId string  `json:"execution-id"`
	Stage       string  `json:"stage"`
	State       string  `json:"state"`
}

PipelineStageDetail represents a stage change event metadata

type RepoNotFoundError

type RepoNotFoundError struct{}

RepoNotFoundError - semantic type to represent '404' from a repo fetch

func (RepoNotFoundError) Error

func (e RepoNotFoundError) Error() string

type Repository

type Repository interface {
	Get(ref string, path string) ([]byte, error)
	Status(sha string, status GitHubStatus) error
}

Repository provides a means to fetch data from the version control repository.

type SecureStore

type SecureStore interface {
	Get(key string) (string, error)
}

SecureStore accesses secure parameters.

type StackManager

type StackManager interface {
	Create(name string, parameters []Parameter, template []byte) error
	Update(name string, parameters []Parameter, template []byte) error
	Delete(name string) error
	Status(name string) (bool, string, error)

	LastUpdated(name string) (*time.Time, error)

	StartBuild(name string) error
	UpdateBuild(name, ref string) error

	CancelUpdate(name string) error
}

StackManager provides a means of managing infrastructure 'stacks' A stack is a collection of resources typically specified by a version controlled file.

Jump to

Keyboard shortcuts

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