Documentation ¶
Index ¶
- func Replay(events []ddd.Event) ddd.Aggregate
- type Created
- type Deployment
- func (d *Deployment) Branch() string
- func (d *Deployment) Destroy(timestamp int64) error
- func (d *Deployment) Destroyed() bool
- func (d *Deployment) Events() []ddd.Event
- func (d *Deployment) FilePath() string
- func (d *Deployment) Name() string
- func (d *Deployment) RepoID() string
- func (d *Deployment) Token() string
- func (d *Deployment) UUID() string
- func (d *Deployment) Update(name, repoID, branch, filePath string, timestamp int64) error
- func (d *Deployment) Version() int
- type Destroyed
- type ReadRepository
- type Service
- func (s Service) All(ctx context.Context, req *pb.ReadDeployments) (*pb.DeploymentsRead, error)
- func (s Service) Approvals(ctx context.Context, req *pb.ReadApprovals) (*pb.ApprovalsRead, error)
- func (s Service) Approve(ctx context.Context, cmd *pb.ApproveStep) (*pb.StepApproved, error)
- func (s Service) Create(ctx context.Context, cmd *pb.CreateDeployment) (*pb.DeploymentCreated, error)
- func (s Service) Destroy(ctx context.Context, cmd *pb.DestroyDeployment) (*pb.DeploymentDestroyed, error)
- func (s Service) Manual(ctx context.Context, cmd *tr.TriggerManual) (*tr.ManualTriggered, error)
- func (s Service) Read(ctx context.Context, req *pb.ReadDeployment) (*pb.DeploymentRead, error)
- func (s Service) Ready() error
- func (s Service) Run(ctx context.Context, req *pb.ReadRun) (*pb.RunRead, error)
- func (s Service) Runs(ctx context.Context, req *pb.ReadRuns) (*pb.RunsRead, error)
- func (s Service) Status(ctx context.Context, cmd *tr.ReadStatus) (*tr.StatusRead, error)
- func (s Service) Template(ctx context.Context, req *pb.TemplateDeployment) (*pb.DeploymentTemplated, error)
- func (s Service) Token(ctx context.Context, req *pb.ReadDeploymentToken) (*pb.DeploymentTokenRead, error)
- func (s Service) Update(ctx context.Context, cmd *pb.UpdateDeployment) (*pb.DeploymentUpdated, error)
- func (s Service) Web(ctx context.Context, cmd *tr.TriggerWeb) (*tr.WebTriggered, error)
- type Updated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Created ¶
type Created struct { Timestamp int64 UUID string Name string Token string RepoID string Branch string FilePath string }
Created is the event for when a new deployment is created
type Deployment ¶
type Deployment struct {
// contains filtered or unexported fields
}
Deployment represents the basic information about a deployment
func Create ¶
func Create(uuid, name, token, 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) RepoID ¶
func (d *Deployment) RepoID() string
RepoID returns the uuid of the repo for this deployment's yaml file
func (*Deployment) Token ¶ added in v0.7.0
func (d *Deployment) Token() string
Token gets this deployment's token
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
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 ¶
NewService creates the service
func (Service) All ¶
func (s Service) All(ctx context.Context, req *pb.ReadDeployments) (*pb.DeploymentsRead, error)
All gets all deployments currently configured and their status
func (Service) Approvals ¶ added in v0.8.0
func (s Service) Approvals(ctx context.Context, req *pb.ReadApprovals) (*pb.ApprovalsRead, error)
Approvals gets all approvals for the user
func (Service) Approve ¶ added in v0.8.0
func (s Service) Approve(ctx context.Context, cmd *pb.ApproveStep) (*pb.StepApproved, error)
Approve a step for a run
func (Service) Create ¶
func (s Service) Create(ctx context.Context, cmd *pb.CreateDeployment) (*pb.DeploymentCreated, error)
Create adds a deployment to the list of configurations
func (Service) Destroy ¶
func (s Service) Destroy(ctx context.Context, cmd *pb.DestroyDeployment) (*pb.DeploymentDestroyed, error)
Destroy removes a deployment from the list of configurations
func (Service) Manual ¶ added in v0.7.0
func (s Service) Manual(ctx context.Context, cmd *tr.TriggerManual) (*tr.ManualTriggered, error)
Manual triggers a deployment manually
func (Service) Read ¶
func (s Service) Read(ctx context.Context, req *pb.ReadDeployment) (*pb.DeploymentRead, error)
Read reads out a deployment
func (Service) Ready ¶
Ready implements the ReadyService method so this service can be part of a health check routine
func (Service) Status ¶ added in v0.8.5
func (s Service) Status(ctx context.Context, cmd *tr.ReadStatus) (*tr.StatusRead, error)
Status gets the status of a run
func (Service) Template ¶
func (s Service) Template(ctx context.Context, req *pb.TemplateDeployment) (*pb.DeploymentTemplated, error)
Template takes a deployment and templates its yaml out for verification and viewing
func (Service) Token ¶ added in v0.7.0
func (s Service) Token(ctx context.Context, req *pb.ReadDeploymentToken) (*pb.DeploymentTokenRead, error)
Token gets the token for this deployment, for use with web calls
func (Service) Update ¶
func (s Service) Update(ctx context.Context, cmd *pb.UpdateDeployment) (*pb.DeploymentUpdated, error)
Update edits an already existing deployment
func (Service) Web ¶ added in v0.7.0
func (s Service) Web(ctx context.Context, cmd *tr.TriggerWeb) (*tr.WebTriggered, error)
Web triggers a deployment from a web call