Documentation ¶
Index ¶
- type MockTerraformCLIStore
- func (_m *MockTerraformCLIStore) CreateTerraformCLIBinaryPresignedURL(ctx context.Context, version string, os string, architecture string) (string, error)
- func (_m *MockTerraformCLIStore) DoesTerraformCLIBinaryExist(ctx context.Context, version string, os string, architecture string) (bool, error)
- func (_m *MockTerraformCLIStore) UploadTerraformCLIBinary(ctx context.Context, version string, os string, architecture string, ...) error
- type Service
- type TerraformCLIStore
- type TerraformCLIVersions
- type TerraformCLIVersionsInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTerraformCLIStore ¶
MockTerraformCLIStore is an autogenerated mock type for the TerraformCLIStore type
func NewMockTerraformCLIStore ¶
func NewMockTerraformCLIStore(t mockConstructorTestingTNewMockTerraformCLIStore) *MockTerraformCLIStore
NewMockTerraformCLIStore creates a new instance of MockTerraformCLIStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockTerraformCLIStore) CreateTerraformCLIBinaryPresignedURL ¶
func (_m *MockTerraformCLIStore) CreateTerraformCLIBinaryPresignedURL(ctx context.Context, version string, os string, architecture string) (string, error)
CreateTerraformCLIBinaryPresignedURL provides a mock function with given fields: ctx, version, os, architecture
func (*MockTerraformCLIStore) DoesTerraformCLIBinaryExist ¶
func (_m *MockTerraformCLIStore) DoesTerraformCLIBinaryExist(ctx context.Context, version string, os string, architecture string) (bool, error)
DoesTerraformCLIBinaryExist provides a mock function with given fields: ctx, version, os, architecture
func (*MockTerraformCLIStore) UploadTerraformCLIBinary ¶
func (_m *MockTerraformCLIStore) UploadTerraformCLIBinary(ctx context.Context, version string, os string, architecture string, body io.Reader) error
UploadTerraformCLIBinary provides a mock function with given fields: ctx, version, os, architecture, body
type Service ¶
type Service interface { GetTerraformCLIVersions(ctx context.Context) (TerraformCLIVersions, error) CreateTerraformCLIDownloadURL(ctx context.Context, input *TerraformCLIVersionsInput) (string, error) }
Service encapsulates the logic for interacting with the CLI service.
func NewService ¶
func NewService( logger logger.Logger, httpClient *http.Client, taskManager asynctask.Manager, cliStore TerraformCLIStore, ) Service
NewService creates an instance of Service
type TerraformCLIStore ¶
type TerraformCLIStore interface { CreateTerraformCLIBinaryPresignedURL(ctx context.Context, version, os, architecture string) (string, error) UploadTerraformCLIBinary(ctx context.Context, version, os, architecture string, body io.Reader) error DoesTerraformCLIBinaryExist(ctx context.Context, version, os, architecture string) (bool, error) }
TerraformCLIStore interface encapsulates the logic for saving Terraform CLI binaries.
func NewCLIStore ¶
func NewCLIStore(objectStore objectstore.ObjectStore) TerraformCLIStore
NewCLIStore creates an instance of the CLIStore interface
type TerraformCLIVersions ¶
type TerraformCLIVersions []string
TerraformCLIVersions represents Terraform CLI versions.
func (TerraformCLIVersions) Latest ¶
func (v TerraformCLIVersions) Latest() string
Latest returns the latest version from the slice i.e. the last element.
func (TerraformCLIVersions) Supported ¶
func (v TerraformCLIVersions) Supported(wantVersion string) error
Supported returns a Tharsis error if the supplied version is not supported.
type TerraformCLIVersionsInput ¶
TerraformCLIVersionsInput is the input for retrieving CLI versions.