app

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package app implements services, co-ordinating between the layers of the project.

Index

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

func (ApplyService) Get

func (s ApplyService) Get(id string) (*otf.Apply, error)

type ConfigurationVersionService

type ConfigurationVersionService struct {
	*otf.ConfigurationVersionFactory
	// contains filtered or unexported fields
}

func (ConfigurationVersionService) Create

func (ConfigurationVersionService) Download

func (s ConfigurationVersionService) Download(id string) ([]byte, error)

func (ConfigurationVersionService) Get

func (ConfigurationVersionService) GetLatest

func (s ConfigurationVersionService) GetLatest(workspaceID string) (*otf.ConfigurationVersion, error)

func (ConfigurationVersionService) List

func (ConfigurationVersionService) Upload

func (s ConfigurationVersionService) Upload(id string, configuration []byte) error

Upload a configuration version blob

type OrganizationService

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

func (OrganizationService) Create

func (OrganizationService) Delete

func (s OrganizationService) Delete(name string) error

func (OrganizationService) Get

func (OrganizationService) GetEntitlements

func (s OrganizationService) GetEntitlements(name string) (*otf.Entitlements, error)

func (OrganizationService) List

func (OrganizationService) Update

type PlanService

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

func NewPlanService

func NewPlanService(db otf.RunStore, bs otf.BlobStore) *PlanService

func (PlanService) Get

func (s PlanService) Get(id string) (*otf.Plan, error)

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 (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 (StateVersionService) Create

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 (StateVersionService) List

type WorkspaceService

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

func (WorkspaceService) Create

func (s WorkspaceService) Create(orgName string, opts *tfe.WorkspaceCreateOptions) (*otf.Workspace, error)

func (WorkspaceService) Delete

func (WorkspaceService) Get

func (WorkspaceService) List

func (WorkspaceService) Lock

func (WorkspaceService) Unlock

func (s WorkspaceService) Unlock(id string) (*otf.Workspace, error)

func (WorkspaceService) Update

Jump to

Keyboard shortcuts

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