tharsis

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MPL-2.0 Imports: 30 Imported by: 1

Documentation

Overview

Package tharsis provides functions for interfacing with the Tharsis API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFoundError added in v0.19.1

func IsNotFoundError(err error) bool

IsNotFoundError returns true if the error is a tharsis Error and contains the ErrNotFound code.

Types

type Apply

type Apply interface {
	UpdateApply(ctx context.Context, input *types.UpdateApplyInput) (*types.Apply, error)
}

Apply implements functions related to Tharsis Apply.

func NewApply

func NewApply(client *Client) Apply

NewApply returns an apply.

type Client

type Client struct {
	ConfigurationVersion       ConfigurationVersion
	GPGKey                     GPGKey
	Group                      Group
	Job                        Job
	ManagedIdentity            ManagedIdentity
	Plan                       Plan
	Apply                      Apply
	Run                        Run
	ServiceAccount             ServiceAccount
	StateVersion               StateVersion
	Variable                   Variable
	Workspaces                 Workspaces
	TerraformProvider          TerraformProvider
	TerraformProviderVersion   TerraformProviderVersion
	TerraformModule            TerraformModule
	TerraformModuleVersion     TerraformModuleVersion
	TerraformModuleAttestation TerraformModuleAttestation
	TerraformProviderPlatform  TerraformProviderPlatform
	TerraformCLIVersions       TerraformCLIVersion
	VCSProvider                VCSProvider
	WorkspaceVCSProviderLink   WorkspaceVCSProviderLink
	// contains filtered or unexported fields
}

Client provides access for the client/user to access the SDK functions. Note: When adding a new field here, make sure to assign the field near the end of the NewClient function.

func NewClient

func NewClient(cfg *config.Config) (*Client, error)

NewClient returns a TharsisClient.

func (*Client) Close

func (c *Client) Close() error

Close client connections

type ConfigurationVersion

type ConfigurationVersion interface {
	GetConfigurationVersion(ctx context.Context,
		input *types.GetConfigurationVersionInput) (*types.ConfigurationVersion, error)
	CreateConfigurationVersion(ctx context.Context,
		input *types.CreateConfigurationVersionInput) (*types.ConfigurationVersion, error)
	DownloadConfigurationVersion(ctx context.Context,
		input *types.GetConfigurationVersionInput, writer io.WriterAt) error
	UploadConfigurationVersion(ctx context.Context, input *types.UploadConfigurationVersionInput) error
}

ConfigurationVersion implements functions related to Tharsis configuration versions.

func NewConfigurationVersion

func NewConfigurationVersion(client *Client) ConfigurationVersion

NewConfigurationVersion returns a ConfigurationVersion object.

type GPGKey added in v0.15.0

type GPGKey interface {
	GetGPGKey(ctx context.Context, input *types.GetGPGKeyInput) (*types.GPGKey, error)
	CreateGPGKey(ctx context.Context, input *types.CreateGPGKeyInput) (*types.GPGKey, error)
	DeleteGPGKey(ctx context.Context, input *types.DeleteGPGKeyInput) (*types.GPGKey, error)
}

GPGKey implements functions related to Tharsis GPG keys.

func NewGPGKey added in v0.15.0

func NewGPGKey(client *Client) GPGKey

NewGPGKey returns a GPG key.

type GetWorkspacesPaginator

type GetWorkspacesPaginator struct {
	// contains filtered or unexported fields
}

GetWorkspacesPaginator is a type-specific paginator.

func (*GetWorkspacesPaginator) HasMore

func (wp *GetWorkspacesPaginator) HasMore() bool

HasMore returns a boolean, whether there is another page (or more):

func (*GetWorkspacesPaginator) Next

Next returns the next page of results:

type GraphQLManagedIdentity

type GraphQLManagedIdentity struct {
	AliasSourceID *graphql.String
	Metadata      internal.GraphQLMetadata
	ID            graphql.String
	Type          graphql.String
	GroupPath     graphql.String
	ResourcePath  graphql.String
	Name          graphql.String
	Description   graphql.String
	Data          graphql.String
	CreatedBy     graphql.String
	IsAlias       graphql.Boolean
}

GraphQLManagedIdentity represents the insides of the query structure, everything in the managed identity object, and with graphql types.

type GraphQLStateVersion

type GraphQLStateVersion struct {
	Metadata internal.GraphQLMetadata
	ID       graphql.String
	Run      struct {
		ID graphql.String
	}
	Outputs []GraphQLStateVersionOutput
}

GraphQLStateVersion represents the insides of the query structure, everything in the state version object, and with graphql types.

type GraphQLStateVersionOutput

type GraphQLStateVersionOutput struct {
	Metadata  internal.GraphQLMetadata
	ID        graphql.String
	Name      graphql.String
	Value     graphql.String
	Type      graphql.String
	Sensitive graphql.Boolean
}

GraphQLStateVersionOutput represents the insides of the query structure, everything in the state version output object, and with graphql types.

type Group

type Group interface {
	GetGroup(ctx context.Context, input *types.GetGroupInput) (*types.Group, error)
	GetGroups(ctx context.Context, input *types.GetGroupsInput) (*types.GetGroupsOutput, error)
	GetGroupPaginator(ctx context.Context, input *types.GetGroupsInput) (*GroupPaginator, error)
	CreateGroup(ctx context.Context, input *types.CreateGroupInput) (*types.Group, error)
	UpdateGroup(ctx context.Context, input *types.UpdateGroupInput) (*types.Group, error)
	DeleteGroup(ctx context.Context, input *types.DeleteGroupInput) error
}

Group implements functions related to Tharsis groups.

func NewGroup

func NewGroup(client *Client) Group

NewGroup returns a Group.

type GroupPaginator

type GroupPaginator struct {
	// contains filtered or unexported fields
}

GroupPaginator is a type-specific paginator.

func (*GroupPaginator) HasMore

func (gp *GroupPaginator) HasMore() bool

HasMore returns a boolean, whether there is another page (or more):

func (*GroupPaginator) Next

Next returns the next page of results:

type Job

type Job interface {
	GetJob(ctx context.Context, input *types.GetJobInput) (*types.Job, error)
	SubscribeToJobCancellationEvent(ctx context.Context, input *types.JobCancellationEventSubscriptionInput) (<-chan *types.CancellationEvent, error)
	SaveJobLogs(ctx context.Context, input *types.SaveJobLogsInput) error
	SubscribeToJobLogs(ctx context.Context, input *types.JobLogsSubscriptionInput) (<-chan *types.JobLogsEvent, error)
}

Job implements functions related to Tharsis jobs.

func NewJob

func NewJob(client *Client) Job

NewJob returns a Job.

type JobLogSubscriptionInput added in v0.19.0

type JobLogSubscriptionInput struct {
	JobID string `json:"jobId"`
}

JobLogSubscriptionInput is the input for subscribing to job log events.

type ManagedIdentity

type ManagedIdentity interface {
	CreateManagedIdentity(ctx context.Context,
		input *types.CreateManagedIdentityInput) (*types.ManagedIdentity, error)
	GetManagedIdentity(ctx context.Context,
		input *types.GetManagedIdentityInput) (*types.ManagedIdentity, error)
	UpdateManagedIdentity(ctx context.Context,
		input *types.UpdateManagedIdentityInput) (*types.ManagedIdentity, error)
	DeleteManagedIdentity(ctx context.Context,
		input *types.DeleteManagedIdentityInput) error
	CreateManagedIdentityCredentials(ctx context.Context,
		input *types.CreateManagedIdentityCredentialsInput) ([]byte, error)
	AssignManagedIdentityToWorkspace(ctx context.Context,
		input *types.AssignManagedIdentityInput) (*types.Workspace, error)
	UnassignManagedIdentityFromWorkspace(ctx context.Context,
		input *types.AssignManagedIdentityInput) (*types.Workspace, error)
	GetManagedIdentityAccessRules(ctx context.Context,
		input *types.GetManagedIdentityInput) ([]types.ManagedIdentityAccessRule, error)
	CreateManagedIdentityAccessRule(ctx context.Context,
		input *types.CreateManagedIdentityAccessRuleInput) (*types.ManagedIdentityAccessRule, error)
	GetManagedIdentityAccessRule(ctx context.Context,
		input *types.GetManagedIdentityAccessRuleInput) (*types.ManagedIdentityAccessRule, error)
	UpdateManagedIdentityAccessRule(ctx context.Context,
		input *types.UpdateManagedIdentityAccessRuleInput) (*types.ManagedIdentityAccessRule, error)
	DeleteManagedIdentityAccessRule(ctx context.Context,
		input *types.DeleteManagedIdentityAccessRuleInput) error
	CreateManagedIdentityAlias(ctx context.Context,
		input *types.CreateManagedIdentityAliasInput) (*types.ManagedIdentity, error)
	DeleteManagedIdentityAlias(ctx context.Context,
		input *types.DeleteManagedIdentityAliasInput) error
}

ManagedIdentity implements functions related to Tharsis ManagedIdentity.

func NewManagedIdentity

func NewManagedIdentity(client *Client) ManagedIdentity

NewManagedIdentity returns a new ManagedIdentity.

type Plan

type Plan interface {
	UpdatePlan(ctx context.Context, input *types.UpdatePlanInput) (*types.Plan, error)
	DownloadPlanCache(ctx context.Context, id string, writer io.WriterAt) error
	UploadPlanCache(ctx context.Context, id string, body io.Reader) error
}

Plan implements functions related to Tharsis Plan.

func NewPlan

func NewPlan(client *Client) Plan

NewPlan returns a plan.

type Run

type Run interface {
	GetRun(ctx context.Context, input *types.GetRunInput) (*types.Run, error)
	GetRuns(ctx context.Context, input *types.GetRunsInput) (*types.GetRunsOutput, error)
	GetRunVariables(ctx context.Context, input *types.GetRunInput) ([]types.RunVariable, error)
	GetRunPaginator(ctx context.Context, input *types.GetRunsInput) (*RunPaginator, error)
	CreateRun(ctx context.Context, input *types.CreateRunInput) (*types.Run, error)
	ApplyRun(ctx context.Context, input *types.ApplyRunInput) (*types.Run, error)
	CancelRun(ctx context.Context, input *types.CancelRunInput) (*types.Run, error)
	SubscribeToWorkspaceRunEvents(ctx context.Context, input *types.RunSubscriptionInput) (<-chan *types.Run, error)
}

Run implements functions related to Tharsis runs.

func NewRun

func NewRun(client *Client) Run

NewRun returns a Run.

type RunPaginator

type RunPaginator struct {
	// contains filtered or unexported fields
}

RunPaginator is a type-specific paginator.

func (*RunPaginator) HasMore

func (rp *RunPaginator) HasMore() bool

HasMore returns a boolean, whether there is another page (or more):

func (*RunPaginator) Next

Next returns the next page of results:

type ServiceAccount added in v0.6.0

type ServiceAccount interface {
	CreateServiceAccount(ctx context.Context,
		input *types.CreateServiceAccountInput) (*types.ServiceAccount, error)
	GetServiceAccount(ctx context.Context,
		input *types.GetServiceAccountInput) (*types.ServiceAccount, error)
	UpdateServiceAccount(ctx context.Context,
		input *types.UpdateServiceAccountInput) (*types.ServiceAccount, error)
	DeleteServiceAccount(ctx context.Context,
		input *types.DeleteServiceAccountInput) error
	CreateToken(ctx context.Context,
		input *types.ServiceAccountCreateTokenInput) (*types.ServiceAccountCreateTokenResponse, error)
}

ServiceAccount implements functions related to Tharsis ServiceAccount.

func NewServiceAccount added in v0.6.0

func NewServiceAccount(client *Client) ServiceAccount

NewServiceAccount returns a new ServiceAccount.

type StateVersion

type StateVersion interface {
	CreateStateVersion(ctx context.Context, input *types.CreateStateVersionInput) (*types.StateVersion, error)
	DownloadStateVersion(ctx context.Context, input *types.DownloadStateVersionInput, writer io.WriterAt) error
}

StateVersion implements functions related to a Tharsis state version.

func NewStateVersion

func NewStateVersion(client *Client) StateVersion

NewStateVersion returns a StateVersion.

type TerraformCLIVersion

type TerraformCLIVersion interface {
	CreateTerraformCLIDownloadURL(ctx context.Context, input *types.CreateTerraformCLIDownloadURLInput) (string, error)
}

TerraformCLIVersion implements the function related to Terraform CLI Versions.

func NewTerraformCLIVersion

func NewTerraformCLIVersion(client *Client) TerraformCLIVersion

NewTerraformCLIVersion returns a TerraformCLIVersion object.

type TerraformModule added in v0.5.0

TerraformModule implements functions related to Tharsis modules.

func NewTerraformModule added in v0.5.0

func NewTerraformModule(client *Client) TerraformModule

NewTerraformModule returns a TerraformModule.

type TerraformModuleAttestation added in v0.14.0

type TerraformModuleAttestation interface {
	GetModuleAttestations(ctx context.Context, input *types.GetTerraformModuleAttestationsInput) (*types.GetTerraformModuleAttestationsOutput, error)
	CreateModuleAttestation(ctx context.Context, input *types.CreateTerraformModuleAttestationInput) (*types.TerraformModuleAttestation, error)
	UpdateModuleAttestation(ctx context.Context, input *types.UpdateTerraformModuleAttestationInput) (*types.TerraformModuleAttestation, error)
	DeleteModuleAttestation(ctx context.Context, input *types.DeleteTerraformModuleAttestationInput) error
}

TerraformModuleAttestation implements functions related to Tharsis module attestations.

func NewTerraformModuleAttestation added in v0.14.0

func NewTerraformModuleAttestation(client *Client) TerraformModuleAttestation

NewTerraformModuleAttestation returns a TerraformModuleAttestation.

type TerraformModuleVersion added in v0.5.0

type TerraformModuleVersion interface {
	GetModuleVersion(ctx context.Context, input *types.GetTerraformModuleVersionInput) (*types.TerraformModuleVersion, error)
	GetModuleVersions(ctx context.Context, input *types.GetTerraformModuleVersionsInput) (*types.GetTerraformModuleVersionsOutput, error)
	CreateModuleVersion(ctx context.Context, input *types.CreateTerraformModuleVersionInput) (*types.TerraformModuleVersion, error)
	UploadModuleVersion(ctx context.Context, moduleVersionID string, reader io.Reader) error
	DeleteModuleVersion(ctx context.Context, input *types.DeleteTerraformModuleVersionInput) error
}

TerraformModuleVersion implements functions related to Tharsis module versions.

func NewTerraformModuleVersion added in v0.5.0

func NewTerraformModuleVersion(client *Client) TerraformModuleVersion

NewTerraformModuleVersion returns a TerraformModuleVersion.

type TerraformProvider

TerraformProvider implements functions related to Tharsis providers.

func NewTerraformProvider

func NewTerraformProvider(client *Client) TerraformProvider

NewTerraformProvider returns a TerraformProvider.

type TerraformProviderPlatform

type TerraformProviderPlatform interface {
	GetProviderPlatform(ctx context.Context, input *types.GetTerraformProviderPlatformInput) (*types.TerraformProviderPlatform, error)
	CreateProviderPlatform(ctx context.Context, input *types.CreateTerraformProviderPlatformInput) (*types.TerraformProviderPlatform, error)
	UploadProviderPlatformBinary(ctx context.Context, providerPlatformID string, reader io.Reader) error
}

TerraformProviderPlatform implements functions related to Tharsis provider platforms.

func NewTerraformProviderPlatform

func NewTerraformProviderPlatform(client *Client) TerraformProviderPlatform

NewTerraformProviderPlatform returns a TerraformProviderPlatform.

type TerraformProviderVersion

type TerraformProviderVersion interface {
	GetProviderVersion(ctx context.Context, input *types.GetTerraformProviderVersionInput) (*types.TerraformProviderVersion, error)
	CreateProviderVersion(ctx context.Context, input *types.CreateTerraformProviderVersionInput) (*types.TerraformProviderVersion, error)
	UploadProviderReadme(ctx context.Context, providerVersionID string, reader io.Reader) error
	UploadProviderChecksums(ctx context.Context, providerVersionID string, reader io.Reader) error
	UploadProviderChecksumSignature(ctx context.Context, providerVersionID string, reader io.Reader) error
}

TerraformProviderVersion implements functions related to Tharsis providerVersions.

func NewTerraformProviderVersion

func NewTerraformProviderVersion(client *Client) TerraformProviderVersion

NewTerraformProviderVersion returns a TerraformProviderVersion.

type VCSProvider added in v0.15.0

type VCSProvider interface {
	GetProvider(ctx context.Context, input *types.GetVCSProviderInput) (*types.VCSProvider, error)
	CreateProvider(ctx context.Context, input *types.CreateVCSProviderInput) (*types.CreateVCSProviderResponse, error)
	UpdateProvider(ctx context.Context, input *types.UpdateVCSProviderInput) (*types.VCSProvider, error)
	DeleteProvider(ctx context.Context, input *types.DeleteVCSProviderInput) (*types.VCSProvider, error)
}

VCSProvider implements functions related to Tharsis VCS Providers.

func NewVCSProvider added in v0.15.0

func NewVCSProvider(client *Client) VCSProvider

NewVCSProvider returns a VCS provider.

type Variable added in v0.6.0

Variable implements functions related to Tharsis Variable.

func NewVariable added in v0.6.0

func NewVariable(client *Client) Variable

NewVariable returns a new Variable.

WorkspaceVCSProviderLink implements functions related to Tharsis workspace VCS provider links.

func NewWorkspaceVCSProviderLink(client *Client) WorkspaceVCSProviderLink

NewWorkspaceVCSProviderLink returns a workspace VCS provider link.

type Workspaces

type Workspaces interface {
	GetWorkspace(ctx context.Context, input *types.GetWorkspaceInput) (*types.Workspace, error)
	GetWorkspaces(ctx context.Context, input *types.GetWorkspacesInput) (*types.GetWorkspacesOutput, error)
	GetWorkspacePaginator(ctx context.Context, input *types.GetWorkspacesInput) (*GetWorkspacesPaginator, error)
	CreateWorkspace(ctx context.Context, workspace *types.CreateWorkspaceInput) (*types.Workspace, error)
	UpdateWorkspace(ctx context.Context, workspace *types.UpdateWorkspaceInput) (*types.Workspace, error)
	DeleteWorkspace(ctx context.Context, workspace *types.DeleteWorkspaceInput) error
	GetAssignedManagedIdentities(ctx context.Context, input *types.GetAssignedManagedIdentitiesInput) ([]types.ManagedIdentity, error)
}

Workspaces implements functions related to Tharsis workspaces.

func NewWorkspaces

func NewWorkspaces(client *Client) Workspaces

NewWorkspaces returns a Workspaces.

Directories

Path Synopsis
Package auth package
Package auth package
Package config package
Package config package
Package types contains the type definitions for the SDK
Package types contains the type definitions for the SDK

Jump to

Keyboard shortcuts

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