provider

package
v0.0.0-...-1a35cda Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWorkspace

func GetWorkspace(ctx context.Context, workspaces Workspaces, workspaceName string) (bool, error)

Scans prefetched workspace data for a particular workspace. Returns (isLive, error) where isLive is true if the workspace is a live workspace, and false if it is a development workspace. If error != nil, then the value of isLive is undefined.

func New

func New(version string) func() provider.Provider

New is a helper function to simplify provider server and testing implementation.

func NewAccessPolicyResource

func NewAccessPolicyResource() resource.Resource

NewWorkspaceResource is a helper function to simplify the provider implementation.

func NewWorkspaceResource

func NewWorkspaceResource() resource.Resource

NewWorkspaceResource is a helper function to simplify the provider implementation.

func SliceDifference

func SliceDifference(a, b []types.String) []string

Returns elements that are in a that are not in b.

Types

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value string
}

A type to store a key-value pair in a map.

type ProviderData

type ProviderData struct {
	CommandEnv    []string
	WorkspaceData Workspaces
}

ProviderData stores all the data that datasources and resources need from the provider.

type TectonProvider

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

TectonProvider defines the provider implementation.

func (*TectonProvider) Configure

Configure prepares a Tecton API client for data sources and resources.

func (*TectonProvider) DataSources

func (p *TectonProvider) DataSources(ctx context.Context) []func() datasource.DataSource

Resources defines the resources implemented in the provider.

func (*TectonProvider) Metadata

Metadata returns the provider type name.

func (*TectonProvider) Resources

func (p *TectonProvider) Resources(ctx context.Context) []func() resource.Resource

DataSources defines the data sources implemented in the provider.

func (*TectonProvider) Schema

Schema defines the provider-level schema for configuration data.

type TectonProviderModel

type TectonProviderModel struct {
	Url    types.String `tfsdk:"url"`
	ApiKey types.String `tfsdk:"api_key"`
}

TectonProviderModel maps provider schema data to a Go type.

type Workspaces

type Workspaces struct {
	Lives []string
	Devs  []string
}

Workspaces stores all the workspaces we've found on the Tecton instance.

func ListWorkspaces

func ListWorkspaces(ctx context.Context, commandEnv []string) (Workspaces, error)

Query the complete list of workspaces in the Tecton instance and parse the output.

Jump to

Keyboard shortcuts

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