jobclient

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package jobclient package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetRun(ctx context.Context, id string) (*types.Run, error)
	GetJob(ctx context.Context, id string) (*types.Job, error)
	GetWorkspace(ctx context.Context, id string) (*types.Workspace, error)
	GetRunVariables(ctx context.Context, runID string) ([]types.RunVariable, error)
	GetAssignedManagedIdentities(ctx context.Context, workspaceID string) ([]types.ManagedIdentity, error)
	GetConfigurationVersion(ctx context.Context, id string) (*types.ConfigurationVersion, error)
	CreateStateVersion(ctx context.Context, runID string, body io.Reader) (*types.StateVersion, error)
	CreateManagedIdentityCredentials(ctx context.Context, managedIdentityID string) ([]byte, error)
	CreateTerraformCLIDownloadURL(ctx context.Context, input *types.CreateTerraformCLIDownloadURLInput) (string, error)
	SaveJobLogs(ctx context.Context, jobID string, startOffset int, buffer []byte) error
	SubscribeToJobCancellationEvent(ctx context.Context, jobID string) (<-chan *types.CancellationEvent, error)
	UpdateApply(ctx context.Context, apply *types.Apply) (*types.Apply, error)
	UpdatePlan(ctx context.Context, apply *types.Plan) (*types.Plan, error)
	UploadPlanCache(ctx context.Context, plan *types.Plan, body io.Reader) error
	UploadPlanData(ctx context.Context, plan *types.Plan, tfPlan *tfjson.Plan, tfProviderScheams *tfjson.ProviderSchemas) error
	DownloadConfigurationVersion(ctx context.Context, configurationVersion *types.ConfigurationVersion, writer io.WriterAt) error
	DownloadStateVersion(ctx context.Context, stateVersion *types.StateVersion, writer io.WriterAt) error
	DownloadPlanCache(ctx context.Context, planID string, writer io.WriterAt) error
	Close() error
	CreateServiceAccountToken(ctx context.Context, serviceAccountPath string, token string) (string, *time.Duration, error)
}

Client interface is used by the Job Executor to interface with the Tharsis API

func NewClient

func NewClient(apiURL string, token string) (Client, error)

NewClient creates an instance of the Client interface

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t mockConstructorTestingTNewMockClient) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockClient) Close

func (_m *MockClient) Close() error

Close provides a mock function with given fields:

func (*MockClient) CreateManagedIdentityCredentials

func (_m *MockClient) CreateManagedIdentityCredentials(ctx context.Context, managedIdentityID string) ([]byte, error)

CreateManagedIdentityCredentials provides a mock function with given fields: ctx, managedIdentityID

func (*MockClient) CreateServiceAccountToken

func (_m *MockClient) CreateServiceAccountToken(ctx context.Context, serviceAccountPath string, token string) (string, *time.Duration, error)

CreateServiceAccountToken provides a mock function with given fields: ctx, serviceAccountPath, token

func (*MockClient) CreateStateVersion

func (_m *MockClient) CreateStateVersion(ctx context.Context, runID string, body io.Reader) (*types.StateVersion, error)

CreateStateVersion provides a mock function with given fields: ctx, runID, body

func (*MockClient) CreateTerraformCLIDownloadURL

func (_m *MockClient) CreateTerraformCLIDownloadURL(ctx context.Context, input *types.CreateTerraformCLIDownloadURLInput) (string, error)

CreateTerraformCLIDownloadURL provides a mock function with given fields: ctx, input

func (*MockClient) DownloadConfigurationVersion

func (_m *MockClient) DownloadConfigurationVersion(ctx context.Context, configurationVersion *types.ConfigurationVersion, writer io.WriterAt) error

DownloadConfigurationVersion provides a mock function with given fields: ctx, configurationVersion, writer

func (*MockClient) DownloadPlanCache

func (_m *MockClient) DownloadPlanCache(ctx context.Context, planID string, writer io.WriterAt) error

DownloadPlanCache provides a mock function with given fields: ctx, planID, writer

func (*MockClient) DownloadStateVersion

func (_m *MockClient) DownloadStateVersion(ctx context.Context, stateVersion *types.StateVersion, writer io.WriterAt) error

DownloadStateVersion provides a mock function with given fields: ctx, stateVersion, writer

func (*MockClient) GetAssignedManagedIdentities

func (_m *MockClient) GetAssignedManagedIdentities(ctx context.Context, workspaceID string) ([]types.ManagedIdentity, error)

GetAssignedManagedIdentities provides a mock function with given fields: ctx, workspaceID

func (*MockClient) GetConfigurationVersion

func (_m *MockClient) GetConfigurationVersion(ctx context.Context, id string) (*types.ConfigurationVersion, error)

GetConfigurationVersion provides a mock function with given fields: ctx, id

func (*MockClient) GetJob

func (_m *MockClient) GetJob(ctx context.Context, id string) (*types.Job, error)

GetJob provides a mock function with given fields: ctx, id

func (*MockClient) GetRun

func (_m *MockClient) GetRun(ctx context.Context, id string) (*types.Run, error)

GetRun provides a mock function with given fields: ctx, id

func (*MockClient) GetRunVariables

func (_m *MockClient) GetRunVariables(ctx context.Context, runID string) ([]types.RunVariable, error)

GetRunVariables provides a mock function with given fields: ctx, runID

func (*MockClient) GetWorkspace

func (_m *MockClient) GetWorkspace(ctx context.Context, id string) (*types.Workspace, error)

GetWorkspace provides a mock function with given fields: ctx, id

func (*MockClient) SaveJobLogs

func (_m *MockClient) SaveJobLogs(ctx context.Context, jobID string, startOffset int, buffer []byte) error

SaveJobLogs provides a mock function with given fields: ctx, jobID, startOffset, buffer

func (*MockClient) SubscribeToJobCancellationEvent

func (_m *MockClient) SubscribeToJobCancellationEvent(ctx context.Context, jobID string) (<-chan *types.CancellationEvent, error)

SubscribeToJobCancellationEvent provides a mock function with given fields: ctx, jobID

func (*MockClient) UpdateApply

func (_m *MockClient) UpdateApply(ctx context.Context, apply *types.Apply) (*types.Apply, error)

UpdateApply provides a mock function with given fields: ctx, apply

func (*MockClient) UpdatePlan

func (_m *MockClient) UpdatePlan(ctx context.Context, apply *types.Plan) (*types.Plan, error)

UpdatePlan provides a mock function with given fields: ctx, apply

func (*MockClient) UploadPlanCache

func (_m *MockClient) UploadPlanCache(ctx context.Context, plan *types.Plan, body io.Reader) error

UploadPlanCache provides a mock function with given fields: ctx, plan, body

func (*MockClient) UploadPlanData

func (_m *MockClient) UploadPlanData(ctx context.Context, plan *types.Plan, tfPlan *tfjson.Plan, tfProviderScheams *tfjson.ProviderSchemas) error

UploadPlanData provides a mock function with given fields: ctx, plan, tfPlan, tfProviderScheams

Jump to

Keyboard shortcuts

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