cli

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package cli package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTerraformCLIStore

type MockTerraformCLIStore struct {
	mock.Mock
}

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,
	terraformCLIVersionConstraint string,
) 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

type TerraformCLIVersionsInput struct {
	Version      string
	OS           string
	Architecture string
}

TerraformCLIVersionsInput is the input for retrieving CLI versions.

Jump to

Keyboard shortcuts

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