Documentation
¶
Overview ¶
Package app implements services, co-ordinating between the layers of the project.
Index ¶
- type ApplyService
- type ConfigurationVersionService
- func (s ConfigurationVersionService) Create(workspaceID string, opts *tfe.ConfigurationVersionCreateOptions) (*otf.ConfigurationVersion, error)
- func (s ConfigurationVersionService) Download(id string) ([]byte, error)
- func (s ConfigurationVersionService) Get(id string) (*otf.ConfigurationVersion, error)
- func (s ConfigurationVersionService) GetLatest(workspaceID string) (*otf.ConfigurationVersion, error)
- func (s ConfigurationVersionService) List(workspaceID string, opts tfe.ConfigurationVersionListOptions) (*otf.ConfigurationVersionList, error)
- func (s ConfigurationVersionService) Upload(id string, configuration []byte) error
- type OrganizationService
- func (s OrganizationService) Create(opts *tfe.OrganizationCreateOptions) (*otf.Organization, error)
- func (s OrganizationService) Delete(name string) error
- func (s OrganizationService) Get(name string) (*otf.Organization, error)
- func (s OrganizationService) GetEntitlements(name string) (*otf.Entitlements, error)
- func (s OrganizationService) List(opts tfe.OrganizationListOptions) (*otf.OrganizationList, error)
- func (s OrganizationService) Update(name string, opts *tfe.OrganizationUpdateOptions) (*otf.Organization, error)
- type PlanService
- type RunService
- func (s RunService) Apply(id string, opts *tfe.RunApplyOptions) error
- func (s RunService) Cancel(id string, opts *tfe.RunCancelOptions) error
- func (s RunService) Create(opts *tfe.RunCreateOptions) (*otf.Run, error)
- func (s RunService) Discard(id string, opts *tfe.RunDiscardOptions) error
- func (s RunService) EnqueuePlan(id string) error
- func (s RunService) Finish(id string, opts otf.JobFinishOptions) (otf.Job, error)
- func (s RunService) ForceCancel(id string, opts *tfe.RunForceCancelOptions) error
- func (s RunService) Get(id string) (*otf.Run, error)
- func (s RunService) GetApplyLogs(id string, opts otf.GetChunkOptions) ([]byte, error)
- func (s RunService) GetPlanFile(id string) ([]byte, error)
- func (s RunService) GetPlanJSON(id string) ([]byte, error)
- func (s RunService) GetPlanLogs(id string, opts otf.GetChunkOptions) ([]byte, error)
- func (s RunService) List(opts otf.RunListOptions) (*otf.RunList, error)
- func (s RunService) Start(id string, opts otf.JobStartOptions) (otf.Job, error)
- func (s RunService) UploadLogs(id string, logs []byte, opts otf.PutChunkOptions) error
- func (s RunService) UploadPlan(id string, plan []byte, json bool) error
- type StateVersionService
- func (s StateVersionService) Create(workspaceID string, opts tfe.StateVersionCreateOptions) (*otf.StateVersion, error)
- func (s StateVersionService) Current(workspaceID string) (*otf.StateVersion, error)
- func (s StateVersionService) Download(id string) ([]byte, error)
- func (s StateVersionService) Get(id string) (*otf.StateVersion, error)
- func (s StateVersionService) List(opts tfe.StateVersionListOptions) (*otf.StateVersionList, error)
- type WorkspaceService
- func (s WorkspaceService) Create(orgName string, opts *tfe.WorkspaceCreateOptions) (*otf.Workspace, error)
- func (s WorkspaceService) Delete(spec otf.WorkspaceSpecifier) error
- func (s WorkspaceService) Get(spec otf.WorkspaceSpecifier) (*otf.Workspace, error)
- func (s WorkspaceService) List(opts otf.WorkspaceListOptions) (*otf.WorkspaceList, error)
- func (s WorkspaceService) Lock(id string, _ tfe.WorkspaceLockOptions) (*otf.Workspace, error)
- func (s WorkspaceService) Unlock(id string) (*otf.Workspace, error)
- func (s WorkspaceService) Update(spec otf.WorkspaceSpecifier, opts *tfe.WorkspaceUpdateOptions) (*otf.Workspace, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyService ¶
type ApplyService struct {
// contains filtered or unexported fields
}
func NewApplyService ¶
func NewApplyService(db otf.RunStore) *ApplyService
type ConfigurationVersionService ¶
type ConfigurationVersionService struct {
*otf.ConfigurationVersionFactory
// contains filtered or unexported fields
}
func NewConfigurationVersionService ¶
func NewConfigurationVersionService(db otf.ConfigurationVersionStore, wss otf.WorkspaceService, bs otf.BlobStore) *ConfigurationVersionService
func (ConfigurationVersionService) Create ¶
func (s ConfigurationVersionService) Create(workspaceID string, opts *tfe.ConfigurationVersionCreateOptions) (*otf.ConfigurationVersion, error)
func (ConfigurationVersionService) Download ¶
func (s ConfigurationVersionService) Download(id string) ([]byte, error)
func (ConfigurationVersionService) Get ¶
func (s ConfigurationVersionService) Get(id string) (*otf.ConfigurationVersion, error)
func (ConfigurationVersionService) GetLatest ¶
func (s ConfigurationVersionService) GetLatest(workspaceID string) (*otf.ConfigurationVersion, error)
func (ConfigurationVersionService) List ¶
func (s ConfigurationVersionService) List(workspaceID string, opts tfe.ConfigurationVersionListOptions) (*otf.ConfigurationVersionList, error)
type OrganizationService ¶
type OrganizationService struct {
// contains filtered or unexported fields
}
func NewOrganizationService ¶
func NewOrganizationService(db otf.OrganizationStore, es otf.EventService) *OrganizationService
func (OrganizationService) Create ¶
func (s OrganizationService) Create(opts *tfe.OrganizationCreateOptions) (*otf.Organization, error)
func (OrganizationService) Delete ¶
func (s OrganizationService) Delete(name string) error
func (OrganizationService) Get ¶
func (s OrganizationService) Get(name string) (*otf.Organization, error)
func (OrganizationService) GetEntitlements ¶
func (s OrganizationService) GetEntitlements(name string) (*otf.Entitlements, error)
func (OrganizationService) List ¶
func (s OrganizationService) List(opts tfe.OrganizationListOptions) (*otf.OrganizationList, error)
func (OrganizationService) Update ¶
func (s OrganizationService) Update(name string, opts *tfe.OrganizationUpdateOptions) (*otf.Organization, error)
type PlanService ¶
type PlanService struct {
// contains filtered or unexported fields
}
func NewPlanService ¶
func NewPlanService(db otf.RunStore, bs otf.BlobStore) *PlanService
func (PlanService) GetPlanJSON ¶
func (s PlanService) GetPlanJSON(id string) ([]byte, error)
GetPlanJSON returns the JSON formatted plan file for the plan.
type RunService ¶
type RunService struct {
*otf.RunFactory
// contains filtered or unexported fields
}
func NewRunService ¶
func NewRunService(db otf.RunStore, wss otf.WorkspaceService, cvs otf.ConfigurationVersionService, bs otf.BlobStore, es otf.EventService) *RunService
func (RunService) Apply ¶
func (s RunService) Apply(id string, opts *tfe.RunApplyOptions) error
func (RunService) Cancel ¶
func (s RunService) Cancel(id string, opts *tfe.RunCancelOptions) error
Cancel enqueues a cancel request to cancel a currently queued or active plan or apply.
func (RunService) Create ¶
func (s RunService) Create(opts *tfe.RunCreateOptions) (*otf.Run, error)
Create constructs and persists a new run object to the db, before scheduling the run.
func (RunService) Discard ¶
func (s RunService) Discard(id string, opts *tfe.RunDiscardOptions) error
func (RunService) EnqueuePlan ¶
func (s RunService) EnqueuePlan(id string) error
func (RunService) Finish ¶
func (s RunService) Finish(id string, opts otf.JobFinishOptions) (otf.Job, error)
Finish marks a run phase (plan, apply) as finished. An event is emitted to notify any subscribers of the new run state.
func (RunService) ForceCancel ¶
func (s RunService) ForceCancel(id string, opts *tfe.RunForceCancelOptions) error
func (RunService) Get ¶
func (s RunService) Get(id string) (*otf.Run, error)
Get retrieves a run obj with the given ID from the db.
func (RunService) GetApplyLogs ¶
func (s RunService) GetApplyLogs(id string, opts otf.GetChunkOptions) ([]byte, error)
GetApplyLogs returns logs from the apply of the run identified by id. The options specifies the limit and offset bytes of the logs to retrieve.
func (RunService) GetPlanFile ¶
func (s RunService) GetPlanFile(id string) ([]byte, error)
GetPlanFile returns the binary plan file for the run.
func (RunService) GetPlanJSON ¶
func (s RunService) GetPlanJSON(id string) ([]byte, error)
GetPlanJSON returns the JSON formatted plan file for the run.
func (RunService) GetPlanLogs ¶
func (s RunService) GetPlanLogs(id string, opts otf.GetChunkOptions) ([]byte, error)
GetPlanLogs returns logs from the plan of the run identified by id. The options specifies the limit and offset bytes of the logs to retrieve.
func (RunService) List ¶
func (s RunService) List(opts otf.RunListOptions) (*otf.RunList, error)
List retrieves multiple run objs. Use opts to filter and paginate the list.
func (RunService) Start ¶
func (s RunService) Start(id string, opts otf.JobStartOptions) (otf.Job, error)
Start marks a run phase (plan, apply) as started.
func (RunService) UploadLogs ¶
func (s RunService) UploadLogs(id string, logs []byte, opts otf.PutChunkOptions) error
UploadLogs writes a chunk of logs for a run.
func (RunService) UploadPlan ¶
func (s RunService) UploadPlan(id string, plan []byte, json bool) error
UploadPlan persists a run's plan file. The plan file is expected to have been produced using `terraform plan`. If the plan file is JSON serialized then set json to true.
type StateVersionService ¶
type StateVersionService struct {
*otf.StateVersionFactory
// contains filtered or unexported fields
}
func NewStateVersionService ¶
func NewStateVersionService(db otf.StateVersionStore, wss otf.WorkspaceService, bs otf.BlobStore) *StateVersionService
func (StateVersionService) Create ¶
func (s StateVersionService) Create(workspaceID string, opts tfe.StateVersionCreateOptions) (*otf.StateVersion, error)
func (StateVersionService) Current ¶
func (s StateVersionService) Current(workspaceID string) (*otf.StateVersion, error)
func (StateVersionService) Download ¶
func (s StateVersionService) Download(id string) ([]byte, error)
func (StateVersionService) Get ¶
func (s StateVersionService) Get(id string) (*otf.StateVersion, error)
func (StateVersionService) List ¶
func (s StateVersionService) List(opts tfe.StateVersionListOptions) (*otf.StateVersionList, error)
type WorkspaceService ¶
type WorkspaceService struct {
// contains filtered or unexported fields
}
func NewWorkspaceService ¶
func NewWorkspaceService(db otf.WorkspaceStore, os otf.OrganizationService, es otf.EventService) *WorkspaceService
func (WorkspaceService) Create ¶
func (s WorkspaceService) Create(orgName string, opts *tfe.WorkspaceCreateOptions) (*otf.Workspace, error)
func (WorkspaceService) Delete ¶
func (s WorkspaceService) Delete(spec otf.WorkspaceSpecifier) error
func (WorkspaceService) Get ¶
func (s WorkspaceService) Get(spec otf.WorkspaceSpecifier) (*otf.Workspace, error)
func (WorkspaceService) List ¶
func (s WorkspaceService) List(opts otf.WorkspaceListOptions) (*otf.WorkspaceList, error)
func (WorkspaceService) Lock ¶
func (s WorkspaceService) Lock(id string, _ tfe.WorkspaceLockOptions) (*otf.Workspace, error)
func (WorkspaceService) Unlock ¶
func (s WorkspaceService) Unlock(id string) (*otf.Workspace, error)
func (WorkspaceService) Update ¶
func (s WorkspaceService) Update(spec otf.WorkspaceSpecifier, opts *tfe.WorkspaceUpdateOptions) (*otf.Workspace, error)