variable

package
v0.0.31 Latest Latest
Warning

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

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

Documentation

Overview

Package variable is responsible for workspace variables

Index

Constants

View Source
const (
	// https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables/managing-variables#character-limits
	VariableDescriptionMaxChars = 512
	VariableKeyMaxChars         = 128
	VariableValueMaxKB          = 256 // 256*1024 bytes
)

Variables

View Source
var (
	ErrVariableDescriptionMaxExceeded = fmt.Errorf("maximum variable description size (%d chars) exceeded", VariableDescriptionMaxChars)
	ErrVariableKeyMaxExceeded         = fmt.Errorf("maximum variable key size (%d chars) exceeded", VariableKeyMaxChars)
	ErrVariableValueMaxExceeded       = fmt.Errorf("maximum variable value size of %d KB exceeded", VariableValueMaxKB)
)

Functions

func NewApplication

func NewApplication(opts ApplicationOptions) *app

func VariableCategoryPtr

func VariableCategoryPtr(v otf.VariableCategory) *otf.VariableCategory

VariableCategoryPtr returns a pointer to the given category type.

Types

type Client

type Client struct {
	otf.JSONAPIClient
}

func (*Client) ListVariables

func (c *Client) ListVariables(ctx context.Context, workspaceID string) ([]otf.Variable, error)

type Variable

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

func NewTestVariable

func NewTestVariable(t *testing.T, ws *otf.Workspace, opts otf.CreateVariableOptions) *Variable

func NewVariable

func NewVariable(workspaceID string, opts otf.CreateVariableOptions) (*Variable, error)

func (*Variable) Category

func (v *Variable) Category() otf.VariableCategory

func (*Variable) Description

func (v *Variable) Description() string

func (*Variable) HCL

func (v *Variable) HCL() bool

func (*Variable) ID

func (v *Variable) ID() string

func (*Variable) Key

func (v *Variable) Key() string

func (*Variable) MarshalLog

func (v *Variable) MarshalLog() any

func (*Variable) Sensitive

func (v *Variable) Sensitive() bool

func (*Variable) ToJSONAPI

func (v *Variable) ToJSONAPI() any

func (*Variable) Update

func (v *Variable) Update(opts otf.UpdateVariableOptions) error

func (*Variable) Value

func (v *Variable) Value() string

func (*Variable) WorkspaceID

func (v *Variable) WorkspaceID() string

type VariableList

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

VariableList assembles a workspace list JSONAPI DTO

func (*VariableList) ToJSONAPI

func (l *VariableList) ToJSONAPI() any

Jump to

Keyboard shortcuts

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