Documentation ¶
Overview ¶
Package run package
Index ¶
- type CancelRunInput
- type CreateRunInput
- type Event
- type EventSubscriptionOptions
- type GetRunsInput
- type MockModuleResolver
- type MockService
- func (_m *MockService) ApplyRun(ctx context.Context, runID string, comment *string) (*models.Run, error)
- func (_m *MockService) CancelRun(ctx context.Context, options *CancelRunInput) (*models.Run, error)
- func (_m *MockService) CreateRun(ctx context.Context, options *CreateRunInput) (*models.Run, error)
- func (_m *MockService) DownloadPlan(ctx context.Context, planID string) (io.ReadCloser, error)
- func (_m *MockService) GetAppliesByIDs(ctx context.Context, idList []string) ([]models.Apply, error)
- func (_m *MockService) GetApply(ctx context.Context, applyID string) (*models.Apply, error)
- func (_m *MockService) GetLatestJobForApply(ctx context.Context, applyID string) (*models.Job, error)
- func (_m *MockService) GetLatestJobForPlan(ctx context.Context, planID string) (*models.Job, error)
- func (_m *MockService) GetPlan(ctx context.Context, planID string) (*models.Plan, error)
- func (_m *MockService) GetPlansByIDs(ctx context.Context, idList []string) ([]models.Plan, error)
- func (_m *MockService) GetRun(ctx context.Context, runID string) (*models.Run, error)
- func (_m *MockService) GetRunVariables(ctx context.Context, runID string) ([]Variable, error)
- func (_m *MockService) GetRuns(ctx context.Context, input *GetRunsInput) (*db.RunsResult, error)
- func (_m *MockService) GetRunsByIDs(ctx context.Context, idList []string) ([]models.Run, error)
- func (_m *MockService) SubscribeToRunEvents(ctx context.Context, options *EventSubscriptionOptions) (<-chan *Event, error)
- func (_m *MockService) UpdateApply(ctx context.Context, apply *models.Apply) (*models.Apply, error)
- func (_m *MockService) UpdatePlan(ctx context.Context, plan *models.Plan) (*models.Plan, error)
- func (_m *MockService) UploadPlan(ctx context.Context, planID string, reader io.Reader) error
- type ModuleRegistrySource
- type ModuleResolver
- type Service
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CancelRunInput ¶
CancelRunInput is the input for canceling a run.
type CreateRunInput ¶
type CreateRunInput struct { ConfigurationVersionID *string Comment *string ModuleSource *string ModuleVersion *string WorkspaceID string TerraformVersion string Variables []Variable TargetAddresses []string IsDestroy bool Refresh bool }
CreateRunInput is the input for creating a new run
func (CreateRunInput) Validate ¶
func (c CreateRunInput) Validate() error
Validate attempts to ensure the CreateRunInput structure is in good form and able to be used.
type EventSubscriptionOptions ¶
EventSubscriptionOptions provides options for subscribing to run events
type GetRunsInput ¶
type GetRunsInput struct { // Sort specifies the field to sort on and direction Sort *db.RunSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // Workspace filters the runs by the specified workspace Workspace *models.Workspace // Group filters the runs by the specified group Group *models.Group }
GetRunsInput is the input for querying a list of runs
type MockModuleResolver ¶ added in v0.3.0
MockModuleResolver is an autogenerated mock type for the ModuleResolver type
func NewMockModuleResolver ¶ added in v0.3.0
func NewMockModuleResolver(t mockConstructorTestingTNewMockModuleResolver) *MockModuleResolver
NewMockModuleResolver creates a new instance of MockModuleResolver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockModuleResolver) ParseModuleRegistrySource ¶ added in v0.3.0
func (_m *MockModuleResolver) ParseModuleRegistrySource(ctx context.Context, moduleSource string) (*ModuleRegistrySource, error)
ParseModuleRegistrySource provides a mock function with given fields: ctx, moduleSource
func (*MockModuleResolver) ResolveModuleVersion ¶ added in v0.3.0
func (_m *MockModuleResolver) ResolveModuleVersion(ctx context.Context, source *ModuleRegistrySource, wantVersion *string, variables []Variable) (string, error)
ResolveModuleVersion provides a mock function with given fields: ctx, source, wantVersion, variables
type MockService ¶
MockService is an autogenerated mock type for the Service type
func NewMockService ¶
func NewMockService(t mockConstructorTestingTNewMockService) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockService) ApplyRun ¶
func (_m *MockService) ApplyRun(ctx context.Context, runID string, comment *string) (*models.Run, error)
ApplyRun provides a mock function with given fields: ctx, runID, comment
func (*MockService) CancelRun ¶
func (_m *MockService) CancelRun(ctx context.Context, options *CancelRunInput) (*models.Run, error)
CancelRun provides a mock function with given fields: ctx, options
func (*MockService) CreateRun ¶
func (_m *MockService) CreateRun(ctx context.Context, options *CreateRunInput) (*models.Run, error)
CreateRun provides a mock function with given fields: ctx, options
func (*MockService) DownloadPlan ¶
func (_m *MockService) DownloadPlan(ctx context.Context, planID string) (io.ReadCloser, error)
DownloadPlan provides a mock function with given fields: ctx, planID
func (*MockService) GetAppliesByIDs ¶
func (_m *MockService) GetAppliesByIDs(ctx context.Context, idList []string) ([]models.Apply, error)
GetAppliesByIDs provides a mock function with given fields: ctx, idList
func (*MockService) GetLatestJobForApply ¶
func (_m *MockService) GetLatestJobForApply(ctx context.Context, applyID string) (*models.Job, error)
GetLatestJobForApply provides a mock function with given fields: ctx, applyID
func (*MockService) GetLatestJobForPlan ¶
GetLatestJobForPlan provides a mock function with given fields: ctx, planID
func (*MockService) GetPlansByIDs ¶
GetPlansByIDs provides a mock function with given fields: ctx, idList
func (*MockService) GetRunVariables ¶
GetRunVariables provides a mock function with given fields: ctx, runID
func (*MockService) GetRuns ¶
func (_m *MockService) GetRuns(ctx context.Context, input *GetRunsInput) (*db.RunsResult, error)
GetRuns provides a mock function with given fields: ctx, input
func (*MockService) GetRunsByIDs ¶
GetRunsByIDs provides a mock function with given fields: ctx, idList
func (*MockService) SubscribeToRunEvents ¶
func (_m *MockService) SubscribeToRunEvents(ctx context.Context, options *EventSubscriptionOptions) (<-chan *Event, error)
SubscribeToRunEvents provides a mock function with given fields: ctx, options
func (*MockService) UpdateApply ¶
UpdateApply provides a mock function with given fields: ctx, apply
func (*MockService) UpdatePlan ¶
UpdatePlan provides a mock function with given fields: ctx, plan
func (*MockService) UploadPlan ¶
UploadPlan provides a mock function with given fields: ctx, planID, reader
type ModuleRegistrySource ¶ added in v0.3.0
type ModuleRegistrySource struct { RegistryURL *url.URL ModuleID *string // This field is only set for modules in the tharsis module registry Host string Namespace string Name string TargetSystem string }
ModuleRegistrySource is the parsed Terraform module source
type ModuleResolver ¶
type ModuleResolver interface { ParseModuleRegistrySource(ctx context.Context, moduleSource string) (*ModuleRegistrySource, error) ResolveModuleVersion(ctx context.Context, source *ModuleRegistrySource, wantVersion *string, variables []Variable) (string, error) }
ModuleResolver encapsulates the logic to resolve module source version string(s).
func NewModuleResolver ¶
func NewModuleResolver(moduleService moduleregistry.Service, httpClient *http.Client, logger logger.Logger, tharsiAPIEndpoint string) ModuleResolver
NewModuleResolver returns
type Service ¶
type Service interface { GetRun(ctx context.Context, runID string) (*models.Run, error) GetRuns(ctx context.Context, input *GetRunsInput) (*db.RunsResult, error) GetRunsByIDs(ctx context.Context, idList []string) ([]models.Run, error) CreateRun(ctx context.Context, options *CreateRunInput) (*models.Run, error) ApplyRun(ctx context.Context, runID string, comment *string) (*models.Run, error) CancelRun(ctx context.Context, options *CancelRunInput) (*models.Run, error) GetRunVariables(ctx context.Context, runID string) ([]Variable, error) GetPlansByIDs(ctx context.Context, idList []string) ([]models.Plan, error) GetPlan(ctx context.Context, planID string) (*models.Plan, error) UpdatePlan(ctx context.Context, plan *models.Plan) (*models.Plan, error) DownloadPlan(ctx context.Context, planID string) (io.ReadCloser, error) UploadPlan(ctx context.Context, planID string, reader io.Reader) error GetAppliesByIDs(ctx context.Context, idList []string) ([]models.Apply, error) GetApply(ctx context.Context, applyID string) (*models.Apply, error) UpdateApply(ctx context.Context, apply *models.Apply) (*models.Apply, error) GetLatestJobForPlan(ctx context.Context, planID string) (*models.Job, error) GetLatestJobForApply(ctx context.Context, applyID string) (*models.Job, error) SubscribeToRunEvents(ctx context.Context, options *EventSubscriptionOptions) (<-chan *Event, error) }
Service encapsulates Terraform Enterprise Support
func NewService ¶
func NewService( logger logger.Logger, dbClient *db.Client, artifactStore workspace.ArtifactStore, eventManager *events.EventManager, jobService job.Service, cliService cli.Service, activityService activityevent.Service, moduleService moduleregistry.Service, moduleResolver ModuleResolver, runStateManager *state.RunStateManager, ) Service
NewService creates an instance of Service
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
registry
|
|
addrs
Package addrs package
|
Package addrs package |
getmodules
Package getmodules package
|
Package getmodules package |
Package rules package
|
Package rules package |
Package state package
|
Package state package |