app

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: MPL-2.0 Imports: 4 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 {
	otf.EventService

	logr.Logger
	// contains filtered or unexported fields
}

func NewApplyService

func NewApplyService(db otf.RunStore, logs otf.ChunkStore, logger logr.Logger, es otf.EventService) *ApplyService

func (ApplyService) Finish added in v0.0.8

func (s ApplyService) Finish(ctx context.Context, id string, opts otf.JobFinishOptions) (*otf.Run, error)

Finish marks a apply as having finished. An event is emitted to notify any subscribers of the new state.

func (ApplyService) Get

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

func (ApplyService) GetChunk added in v0.0.8

func (s ApplyService) GetChunk(ctx context.Context, id string, opts otf.GetChunkOptions) ([]byte, error)

GetChunk reads a chunk of logs for a terraform apply.

func (ApplyService) PutChunk added in v0.0.8

func (s ApplyService) PutChunk(ctx context.Context, id string, chunk []byte, opts otf.PutChunkOptions) error

PutChunk writes a chunk of logs for a terraform apply.

func (ApplyService) Start added in v0.0.8

func (s ApplyService) Start(ctx context.Context, id string, opts otf.JobStartOptions) (*otf.Run, error)

Start marks a apply as having started

type ConfigurationVersionService

type ConfigurationVersionService struct {
	logr.Logger

	*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, config []byte) error

Upload a configuration version tarball

type OrganizationService

type OrganizationService struct {
	logr.Logger
	// contains filtered or unexported fields
}

func NewOrganizationService

func NewOrganizationService(db otf.OrganizationStore, logger logr.Logger, es otf.EventService) *OrganizationService

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 {
	otf.EventService

	logr.Logger
	// contains filtered or unexported fields
}

func NewPlanService

func NewPlanService(db otf.RunStore, logs otf.ChunkStore, logger logr.Logger, es otf.EventService) *PlanService

func (PlanService) Finish added in v0.0.8

func (s PlanService) Finish(ctx context.Context, id string, opts otf.JobFinishOptions) (*otf.Run, error)

Finish marks a plan as having finished. An event is emitted to notify any subscribers of the new state.

func (PlanService) Get

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

func (PlanService) GetChunk added in v0.0.8

func (s PlanService) GetChunk(ctx context.Context, id string, opts otf.GetChunkOptions) ([]byte, error)

GetChunk reads a chunk of logs for a terraform plan.

func (PlanService) GetPlanJSON

func (s PlanService) GetPlanJSON(id string) ([]byte, error)

GetPlanJSON returns the JSON formatted plan file for the plan.

func (PlanService) PutChunk added in v0.0.8

func (s PlanService) PutChunk(ctx context.Context, id string, chunk []byte, opts otf.PutChunkOptions) error

PutChunk writes a chunk of logs for a terraform plan.

func (PlanService) Start added in v0.0.8

func (s PlanService) Start(ctx context.Context, id string, opts otf.JobStartOptions) (*otf.Run, error)

Start marks a plan as having started

type RunService

type RunService struct {
	logr.Logger

	*otf.RunFactory
	// contains filtered or unexported fields
}

func (RunService) Apply

func (s RunService) Apply(id string, opts otf.RunApplyOptions) error

func (RunService) Cancel

func (s RunService) Cancel(id string, opts otf.RunCancelOptions) error

Cancel enqueues a cancel request to cancel a currently queued or active plan or apply.

func (RunService) Create

func (s RunService) Create(ctx context.Context, opts otf.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 otf.RunDiscardOptions) error

func (RunService) EnqueuePlan

func (s RunService) EnqueuePlan(id string) error

func (RunService) ForceCancel

func (s RunService) ForceCancel(id string, opts otf.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) GetPlanFile

func (s RunService) GetPlanFile(ctx context.Context, runID string, opts otf.PlanFileOptions) ([]byte, error)

GetPlanFile returns the plan file for the run.

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) UploadPlanFile added in v0.0.8

func (s RunService) UploadPlanFile(ctx context.Context, id string, plan []byte, opts otf.PlanFileOptions) error

UploadPlanFile 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 its parsed for a summary of planned changes and the Plan object is updated accordingly.

func (RunService) UploadPlanJSON added in v0.0.8

func (s RunService) UploadPlanJSON(ctx context.Context, id string, plan []byte) error

UploadPlanJSON persists a run's JSON-formatted plan file before parsing it and updating the Run's Plan with a summary of planned resource changes. The plan file is expected to have been produced using `terraform show -json plan_file`.

type StateVersionService

type StateVersionService struct {
	*otf.StateVersionFactory

	logr.Logger
	// 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 {
	logr.Logger
	// contains filtered or unexported fields
}

func (WorkspaceService) Create

func (WorkspaceService) Delete

func (WorkspaceService) Get

func (WorkspaceService) List

func (WorkspaceService) Lock

func (WorkspaceService) Unlock

func (s WorkspaceService) Unlock(ctx context.Context, 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