variable

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvironmentVariable

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

EnvironmentVariable is a variable that has a value from an environment variable.

func (*EnvironmentVariable) Name

func (v *EnvironmentVariable) Name() string

Name returns the name of the variable.

func (*EnvironmentVariable) Value

func (v *EnvironmentVariable) Value(ctx context.Context) (any, error)

Value returns the value of the variable.

type LiteralVariable

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

LiteralVariable is a variable that has a literal value.

func (*LiteralVariable) Name

func (v *LiteralVariable) Name() string

Name returns the name of the variable.

func (*LiteralVariable) Value

func (v *LiteralVariable) Value(ctx context.Context) (any, error)

Value returns the value of the variable.

type TemplateVariable

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

TemplateVariable is a variable that has a value from a template.

func (*TemplateVariable) Name

func (v *TemplateVariable) Name() string

Name returns the name of the variable.

func (*TemplateVariable) Value

func (v *TemplateVariable) Value(ctx context.Context) (any, error)

Value returns the value of the variable.

type Variable

type Variable interface {
	// Name returns the name of the variable.
	Name() string
	// Value returns the value of the variable.
	Value(ctx context.Context) (any, error)
}

Variable is a variable that can be used in a template.

func NewEnvironmentVariable

func NewEnvironmentVariable(name string, env string) Variable

NewEnvironmentVariable creates a new environment variable.

func NewLiteralVariable

func NewLiteralVariable(name string, value any) Variable

NewLiteralVariable creates a new literal variable.

func NewTemplateVariable

func NewTemplateVariable(name string, tmpl string) Variable

NewTemplateVariable creates a new template variable.

type Variables

type Variables = []Variable

func FromFile

func FromFile(ctx context.Context, path string) (Variables, error)

Jump to

Keyboard shortcuts

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