types

package
v1.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

The `types` package implements variable types which can be used in configurations. The supported types are `String`, `Duration`, `Int`, `UInt`, `Float`, `Bool` and `Task`. The `Task` type can either be a reference to a task by name, or instance. Binding from reference to an instance is done after configurations are parsed.

Index

Constants

View Source
const (
	ReIdentifier = `[a-zA-Z][a-zA-Z0-9_\-]*`
)

Variables

This section is empty.

Functions

func DomainFqn added in v1.1.5

func DomainFqn(value ...string) string

DomainFqn returns a fully-qualified value, which includes a trailing dot

func DomainInZone added in v1.1.5

func DomainInZone(value, domain string) string

DomainInZone returns unqualified domain name if it is in the zone or an empty string if it is not.

func DomainUnfqn added in v1.1.5

func DomainUnfqn(value, domain string) string

DomainUnfqn remove final domain separator and domain

func IsIdentifier

func IsIdentifier(s string) bool

Return true if the string is a valid identifier

Types

type Bool

type Bool bool

type Duration

type Duration time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

type Eval added in v1.1.1

type Eval string // Evaluation into a different type

func (*Eval) Interpolate added in v1.1.1

func (v *Eval) Interpolate() ([]*Node, error)

Interpolation of a string to return a set of tokens, some of which are strings, and some of which are expression nodes

func (*Eval) InterpolateTokenize added in v1.1.1

func (v *Eval) InterpolateTokenize() ([]string, error)

Interpolation of a string to return a set of string tokens, which are either "${" "$${" or "}" to be recognized as special, or any other string which is interpreted based on context as string or expression

type Float

type Float float64

type Int

type Int int64

type Node added in v1.1.1

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

func NewExpr added in v1.1.1

func NewExpr(v string) *Node

func NewString added in v1.1.1

func NewString(v string) *Node

func (*Node) String added in v1.1.1

func (n *Node) String() string

type NodeType added in v1.1.1

type NodeType uint
const (
	NodeString NodeType = iota
	NodeExpr
)

type String

type String string

type Task

type Task struct {
	iface.Task
	Ref string
}

Task type, which can be either a reference to a task by name, or the instance. Binding from reference to an instance is done after configuration is parsed, in the provider.

func (Task) String

func (t Task) String() string

func (*Task) UnmarshalJSON added in v1.1.3

func (t *Task) UnmarshalJSON(data []byte) error

type UInt

type UInt uint64

Jump to

Keyboard shortcuts

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