deployment

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Replay

func Replay(events []ddd.Event) ddd.Aggregate

Replay recreates the deployment from a series of events

Types

type Created

type Created struct {
	Timestamp int64
	UUID      string
	Name      string
	RepoID    string
	Branch    string
	FilePath  string
}

Created is the event for when a new deployment is created

func (Created) EventType

func (e Created) EventType() string

EventType marks this as an event

type Deployment

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

Deployment represents the basic information about a deployment

func Create

func Create(uuid, name, repoID, branch, filePath string, timestamp int64) (*Deployment, error)

Create handles create commands

func (*Deployment) Branch

func (d *Deployment) Branch() string

Branch returns the branch of the repo for this deployment's yaml file

func (*Deployment) Destroy

func (d *Deployment) Destroy(timestamp int64) error

Destroy handles destroy commands

func (*Deployment) Destroyed

func (d *Deployment) Destroyed() bool

Destroyed determines if this deployment has been destroyed

func (*Deployment) Events

func (d *Deployment) Events() []ddd.Event

Events returns this deployment's event history

func (*Deployment) FilePath

func (d *Deployment) FilePath() string

FilePath returns the file path of the repo for this deployment's yaml file

func (*Deployment) Name

func (d *Deployment) Name() string

Name returns this deployment's name

func (*Deployment) RepoID

func (d *Deployment) RepoID() string

RepoID returns the uuid of the repo for this deployment's yaml file

func (*Deployment) UUID

func (d *Deployment) UUID() string

UUID returns this deployment's identifier

func (*Deployment) Update

func (d *Deployment) Update(name, repoID, branch, filePath string, timestamp int64) error

Update handles update commands

func (*Deployment) Version

func (d *Deployment) Version() int

Version returns this deployment's version number (NOTE: aggregate version!)

type Destroyed

type Destroyed struct {
	Timestamp int64
}

Destroyed is the event for when a deployment is destroyed

func (Destroyed) EventType

func (e Destroyed) EventType() string

EventType marks this as an event

type ReadRepository

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

ReadRepository is the repository for dealing with deployment reads

func NewReadRepository

func NewReadRepository(s storage.Storage) *ReadRepository

NewReadRepository creates a repository with the given storage

func (*ReadRepository) All

func (rr *ReadRepository) All() ([]*Deployment, error)

All gets all deployments

func (*ReadRepository) Load

func (rr *ReadRepository) Load(uuid string) (*Deployment, error)

Load gets one deployment

type Service

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

Service is the implementation for twirp to use

func NewService

func NewService(a auth.Agent, g git.Agent, s storage.Storage) *Service

NewService creates the service

func (Service) All

All gets all deployments currently configured and their status

func (Service) Create

Create adds a deployment to the list of configurations

func (Service) Destroy

Destroy removes a deployment from the list of configurations

func (Service) Read

Read reads out a deployment

func (Service) Ready

func (s Service) Ready() error

Ready implements the ReadyService method so this service can be part of a health check routine

func (Service) Run

func (s Service) Run(ctx context.Context, req *pb.ReadRun) (*pb.RunRead, error)

Run reads all the information about a particular run

func (Service) Runs

func (s Service) Runs(ctx context.Context, req *pb.ReadRuns) (*pb.RunsRead, error)

Runs reads a summary of all runs for a particular deployment

func (Service) Template

Template takes a deployment and templates its yaml out for verification and viewing

func (Service) Trigger

Trigger a deployment

func (Service) Update

Update edits an already existing deployment

type Updated

type Updated struct {
	Timestamp int64
	Name      string
	RepoID    string
	Branch    string
	FilePath  string
}

Updated is the event for when a deployment is updated

func (Updated) EventType

func (e Updated) EventType() string

EventType marks this as an event

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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