function

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFuncCallError

func NewFuncCallError(message string, code FuncCallErrorCode, callStack []*Call) error

NewFuncCallError creates a new instance of a FuncCallError, this should be used to wrap errors that occur during the execution of a substitution function call and in the function execution system.

Types

type AnyParameter

type AnyParameter struct {
	// Name is the name of the parameter for functions that support named arguments.
	Name string
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// UnionTypes is a list of value type definitions that are allowed
	// for the parameter.
	// When provided, an any parameter type is expected to be validated
	// as a union type where the argument must match one of the types.
	UnionTypes []ValueTypeDefinition
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for this parameter can be null.
	AllowNullValue bool
	// Optional determines whether or not the value can be omitted.
	Optional bool
}

AnyParameter is a parameter type definition for any value. This can be used for union types as well as parameters that can accept any type.

func (*AnyParameter) GetAllowNullValue

func (p *AnyParameter) GetAllowNullValue() bool

func (*AnyParameter) GetDescription

func (p *AnyParameter) GetDescription() string

func (*AnyParameter) GetFormattedDescription

func (p *AnyParameter) GetFormattedDescription() string

func (*AnyParameter) GetLabel

func (p *AnyParameter) GetLabel() string

func (*AnyParameter) GetName

func (p *AnyParameter) GetName() string

func (*AnyParameter) GetOptional

func (p *AnyParameter) GetOptional() bool

func (*AnyParameter) GetType

func (p *AnyParameter) GetType() ValueType

type AnyReturn

type AnyReturn struct {
	// This is the type definition for a return value that can be any type.
	Type ValueType
	// UnionTypes is a list of value type definitions that are allowed
	// for the return value.
	// When provided, an any return type will be validated as a union type
	// where the return value must match one of the types in the union.
	UnionTypes []ValueTypeDefinition
	// Description is a human-readable description of
	// the return value. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the return value that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

AnyReturn defines a return type that allows any value type.

func (*AnyReturn) GetDescription

func (r *AnyReturn) GetDescription() string

func (*AnyReturn) GetFormattedDescription

func (r *AnyReturn) GetFormattedDescription() string

func (*AnyReturn) GetType

func (r *AnyReturn) GetType() ValueType

type AttributeType

type AttributeType struct {
	// ValueTypeDefinition is the type definition for the attribute.
	Type ValueTypeDefinition
	// AllowNullValue determines whether or not an attribute
	// of an object in a parameter or return type can be null.
	AllowNullValue bool
}

AttributeType provides a wrapper around a value type definition that allows specific attributes of an object to be null.

type Call

type Call struct {
	// FilePath is the file path of the source blueprint
	// where the function call is located.
	// This is especially useful for debugging projects with multiple
	// blueprints or in a multi-stage validation/deployment process
	// where the blueprint is one of many files that could have caused
	// an error.
	FilePath     string
	FunctionName string
	// Location is derived from the location of the function
	// call in the source blueprint that is captured in the schema
	// and substitution parsing process.
	Location *source.Meta
}

Call holds information for a function call in a call stack.

type Definition

type Definition struct {
	// Name is the name of the function that is used in a blueprint "${..}" substitution.
	// This must be globally unique.
	Name string
	// Summary is a human-readable summary of the function
	// to be used in documentation and tooling when listing
	// functions.
	Summary string
	// FormattedSummary is a human-readable summary of the function
	// that is formatted with markdown.
	FormattedSummary string
	// Description is a human-readable description of the function.
	Description string
	// FormattedDescription is a human-readable description of the function
	// that is formatted with markdown.
	FormattedDescription string
	// Parameters provides a definition of the parameters that are expected
	// to be passed into the function.
	// The order of the parameters is important as it will be used to match
	// arguments passed into the function.
	Parameters []Parameter
	// Return provides a definition of the return type of the function.
	// Return types are always expected as provider functions are expected to
	// be pure functions that return an output based on the input arguments
	// without side effects.
	// Functions can also return other functions that can be shared,
	// this especially useful for function composition and partial application
	// of functions used in mapping over arrays or similar operations.
	Return Return
	// Internal determines whether or not the function is an internal function
	// that should not be exposed to end-users.
	// Some internal functions are required to enable capabilities such as
	// function composition, piping and a small collection of other higher-order
	// functions.
	Internal bool
}

Definition describes a function that can be used in a blueprint "${..}" substitution. This is used to define the parameters and return types of a function that is used to validate arguments passed into a function and the return value of a function.

type FuncCallError

type FuncCallError struct {
	Code      FuncCallErrorCode
	Message   string
	CallStack []*Call
}

FuncCallError is an error type that represents an error that occurred during the execution of a substitution function call. This must be used to wrap errors that occur during the execution of a substitution function call to allow the system to pass structured errors across process boundaries when inter-process plugins are used by a tool built on top of the framework.

func (*FuncCallError) Error

func (f *FuncCallError) Error() string

type FuncCallErrorCode

type FuncCallErrorCode int

FuncCallErrorCode is an enumeration of error codes that can be used to identify the type of error that occurred during the execution of a substitution function call.

const (
	// FuncCallErrorCodeUnknown is an error code that indicates an unknown
	// error occurred during the execution of a substitution function call.
	// This is the default as 0 is the default value when an error code
	// is not set.
	FuncCallErrorCodeUnknown FuncCallErrorCode = iota

	// FuncCallErrorCodeInvalidArgumentType is an error code that indicates
	// that an argument passed to a function is of an invalid type.
	FuncCallErrorCodeInvalidArgumentType

	// FuncCallErrorCodeInvalidArgsOffset is an error code that indicates
	// that an invalid args offset was defined for a partially applied
	// function.
	FuncCallErrorCodeInvalidArgsOffset

	// FuncCallErrorCodeFunctionCall is an error code that indicates that an
	// error occurred during the execution of a function call.
	FuncCallErrorCodeFunctionCall

	// FuncCallErrorCodeInvalidInput is an error code that indicates that an
	// error occurred during the execution of a function call due to invalid
	// arguments. (e.g. an invalid JSON string passed into "jsondecode" or "fromjson")
	FuncCallErrorCodeInvalidInput

	// FuncCallErrorCodeInvalidReturnType is an error code that indicates
	// that the return type of a function is invalid.
	FuncCallErrorCodeInvalidReturnType

	// FuncCallErrorCodeSystem is an error code that indicates an error
	// with the function call system.
	FuncCallErrorCodeSystem

	// FuncCallErrorCodeFunctionNotFound is an error code that indicates
	// that the function to be called was not found in the registry.
	FuncCallErrorCodeFunctionNotFound
)

type FunctionParameter

type FunctionParameter struct {
	// Name is the name of the parameter for functions that support named arguments.
	Name string
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Type of function that represents the type signature
	// that defines the parameters and return type of the function.
	FunctionType ValueTypeDefinition
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for this parameter can be null.
	AllowNullValue bool
	// Optional determines whether or not the value can be omitted.
	Optional bool
}

FunctionParameter is a parameter type definition for a function that can be passed into another function.

func (*FunctionParameter) GetAllowNullValue

func (p *FunctionParameter) GetAllowNullValue() bool

func (*FunctionParameter) GetDescription

func (p *FunctionParameter) GetDescription() string

func (*FunctionParameter) GetFormattedDescription

func (p *FunctionParameter) GetFormattedDescription() string

func (*FunctionParameter) GetLabel

func (p *FunctionParameter) GetLabel() string

func (*FunctionParameter) GetName

func (p *FunctionParameter) GetName() string

func (*FunctionParameter) GetOptional

func (p *FunctionParameter) GetOptional() bool

func (*FunctionParameter) GetType

func (p *FunctionParameter) GetType() ValueType

type FunctionReturn

type FunctionReturn struct {
	// FunctionType is the type definition for the function that is returned.
	// This should be a type definition of the function signature
	// that defines the parameters and return type of the function.
	FunctionType ValueTypeDefinition
	// Description is a human-readable description of
	// the return value. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the return value that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

FunctionReturn defines a return type for a function that can be returned from another function.

func (*FunctionReturn) GetDescription

func (r *FunctionReturn) GetDescription() string

func (*FunctionReturn) GetFormattedDescription

func (r *FunctionReturn) GetFormattedDescription() string

func (*FunctionReturn) GetType

func (r *FunctionReturn) GetType() ValueType

type ListParameter

type ListParameter struct {
	// Name is the name of the parameter for functions that support named arguments.
	Name string
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Type of elements in the list, an argument will be validated
	// against this type.
	ElementType ValueTypeDefinition
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for this parameter can be null.
	AllowNullValue bool
	// Optional determines whether or not the value can be omitted.
	Optional bool
}

ListParameter is a parameter type definition for lists of values.

func (*ListParameter) GetAllowNullValue

func (p *ListParameter) GetAllowNullValue() bool

func (*ListParameter) GetDescription

func (p *ListParameter) GetDescription() string

func (*ListParameter) GetFormattedDescription

func (p *ListParameter) GetFormattedDescription() string

func (*ListParameter) GetLabel

func (p *ListParameter) GetLabel() string

func (*ListParameter) GetName

func (p *ListParameter) GetName() string

func (*ListParameter) GetOptional

func (p *ListParameter) GetOptional() bool

func (*ListParameter) GetType

func (p *ListParameter) GetType() ValueType

type ListReturn

type ListReturn struct {
	// ElementType is the type definition for the elements in the list.
	ElementType ValueTypeDefinition
	// Description is a human-readable description of
	// the return value. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the return value that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ListReturn defines a return type for a list of values with a single type.

func (*ListReturn) GetDescription

func (r *ListReturn) GetDescription() string

func (*ListReturn) GetFormattedDescription

func (r *ListReturn) GetFormattedDescription() string

func (*ListReturn) GetType

func (r *ListReturn) GetType() ValueType

type MapParameter

type MapParameter struct {
	// Name is the name of the parameter for functions that support named arguments.
	Name string
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Type of values in the map, an argument will be validated
	// against this type.
	ElementType ValueTypeDefinition
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for this parameter can be null.
	AllowNullValue bool
	// Optional determines whether or not the value can be omitted.
	Optional bool
}

MapParameter is a parameter type definition for a mapping of strings to values.

func (*MapParameter) GetAllowNullValue

func (p *MapParameter) GetAllowNullValue() bool

func (*MapParameter) GetDescription

func (p *MapParameter) GetDescription() string

func (*MapParameter) GetFormattedDescription

func (p *MapParameter) GetFormattedDescription() string

func (*MapParameter) GetLabel

func (p *MapParameter) GetLabel() string

func (*MapParameter) GetName

func (p *MapParameter) GetName() string

func (*MapParameter) GetOptional

func (p *MapParameter) GetOptional() bool

func (*MapParameter) GetType

func (p *MapParameter) GetType() ValueType

type MapReturn

type MapReturn struct {
	// ElementType is the type definition for the values in the map.
	ElementType ValueTypeDefinition
	// Description is a human-readable description of
	// the return value. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the return value that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

MapReturn defines a return type for a mapping of strings to values with a single type.

func (*MapReturn) GetDescription

func (r *MapReturn) GetDescription() string

func (*MapReturn) GetFormattedDescription

func (r *MapReturn) GetFormattedDescription() string

func (*MapReturn) GetType

func (r *MapReturn) GetType() ValueType

type ObjectParameter

type ObjectParameter struct {
	// Name is the name of the parameter for functions that support named arguments.
	Name string
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// The type of the object that defines the attributes
	// and their types.
	ObjectValueType ValueTypeDefinition
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for this parameter can be null.
	AllowNullValue bool
	// Optional determines whether or not the value can be omitted.
	Optional bool
}

ObjectParameter is a parameter type definition for a predefined object structure with known attributes.

func (*ObjectParameter) GetAllowNullValue

func (p *ObjectParameter) GetAllowNullValue() bool

func (*ObjectParameter) GetDescription

func (p *ObjectParameter) GetDescription() string

func (*ObjectParameter) GetFormattedDescription

func (p *ObjectParameter) GetFormattedDescription() string

func (*ObjectParameter) GetLabel

func (p *ObjectParameter) GetLabel() string

func (*ObjectParameter) GetName

func (p *ObjectParameter) GetName() string

func (*ObjectParameter) GetOptional

func (p *ObjectParameter) GetOptional() bool

func (*ObjectParameter) GetType

func (p *ObjectParameter) GetType() ValueType

type ObjectReturn

type ObjectReturn struct {
	// The type of the object that defines the attributes
	// and their types.
	ObjectValueType ValueTypeDefinition
	// Description is a human-readable description of
	// the return value. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the return value that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ObjectReturn defines a return type for a predefined object structure with known attributes.

func (*ObjectReturn) GetDescription

func (r *ObjectReturn) GetDescription() string

func (*ObjectReturn) GetFormattedDescription

func (r *ObjectReturn) GetFormattedDescription() string

func (*ObjectReturn) GetType

func (r *ObjectReturn) GetType() ValueType

type Parameter

type Parameter interface {
	// GetName returns the name of the parameter for functions
	// that support named arguments.
	GetName() string
	// GetLabel returns the usage name for the parameter.
	GetLabel() string
	// GetType returns the type name of the parameter.
	GetType() ValueType
	// GetDescription returns a human-readable description of the parameter
	// that is not formatted.
	GetDescription() string
	// GetFormattedDescription returns a human-readable description of the parameter
	// that is formatted with markdown.
	GetFormattedDescription() string
	// GetAllowNullValue returns whether or
	// not an argument passed in for this parameter can be null.
	GetAllowNullValue() bool
	// GetOptional determines whether or not the value can be omitted.
	GetOptional() bool
}

Parameter is a parameter type definition for arguments passed into a function.

type Return

type Return interface {
	// GetType retrieves the type name of the return value.
	GetType() ValueType
	// GetDescription returns a human-readable description of the return value
	// that is not formatted.
	GetDescription() string
	// GetFormattedDescription returns a human-readable description of the return value
	// that is formatted with markdown.
	GetFormattedDescription() string
}

Return is a return type definition for the return value of a function.

type ScalarParameter

type ScalarParameter struct {
	// Name is the name of the parameter for functions that support named arguments.
	Name string
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Type of the parameter, an argument will be validated
	// against this type.
	Type ValueTypeDefinition
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for this parameter can be null.
	AllowNullValue bool
	// Optional determines whether or not the value can be omitted.
	Optional bool
}

ScalarParameter is a parameter type definition for primitive types.

func (*ScalarParameter) GetAllowNullValue

func (p *ScalarParameter) GetAllowNullValue() bool

func (*ScalarParameter) GetDescription

func (p *ScalarParameter) GetDescription() string

func (*ScalarParameter) GetFormattedDescription

func (p *ScalarParameter) GetFormattedDescription() string

func (*ScalarParameter) GetLabel

func (p *ScalarParameter) GetLabel() string

func (*ScalarParameter) GetName

func (p *ScalarParameter) GetName() string

func (*ScalarParameter) GetOptional

func (p *ScalarParameter) GetOptional() bool

func (*ScalarParameter) GetType

func (p *ScalarParameter) GetType() ValueType

type ScalarReturn

type ScalarReturn struct {
	// This is the type definition for the scalar return value,
	// this should be a type definition that uses one of the scalar
	// value types such as ValueTypeString, ValueTypeInt32, etc.
	Type ValueTypeDefinition
	// Description is a human-readable description of
	// the return value. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the return value that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ScalarReturn defines a return type for a primitive type.

func (*ScalarReturn) GetDescription

func (r *ScalarReturn) GetDescription() string

func (*ScalarReturn) GetFormattedDescription

func (r *ScalarReturn) GetFormattedDescription() string

func (*ScalarReturn) GetType

func (r *ScalarReturn) GetType() ValueType

type Stack

type Stack interface {
	// Push a new function call onto the stack.
	Push(call *Call)
	// Pop the top function call from the stack.
	Pop() *Call
	// Snapshot returns a snapshot of the current stack.
	Snapshot() []*Call
	// Clone returns a copy of the stack.
	Clone() Stack
}

Stack is an interface for a stack of function calls.

func NewStack

func NewStack() Stack

NewStack creates a new instance of a function call stack.

type ValueType

type ValueType string

ValueType is used as an enum for the value types that are supported for parameters and return types for provider functions.

const (
	// ValueTypeString is for strings.
	ValueTypeString ValueType = "string"

	// ValueTypeBytes is for byte arrays.
	ValueTypeBytes ValueType = "bytes"

	// ValueTypeInt32 is for 32-bit signed integers.
	ValueTypeInt32 ValueType = "int32"

	// ValueTypeInt64 is for 64-bit signed integers.
	ValueTypeInt64 ValueType = "int64"

	// ValueTypeUint32 is for 32-bit unsigned integers.
	ValueTypeUint32 ValueType = "uint32"

	// ValueTypeUint64 is for 64-bit unsigned integers.
	ValueTypeUint64 ValueType = "uint64"

	// ValueTypeFloat32 is for 32-bit floating point numbers.
	ValueTypeFloat32 ValueType = "float32"

	// ValueTypeFloat64 is for 64-bit floating point numbers.
	ValueTypeFloat64 ValueType = "float64"

	// ValueTypeBool is for boolean values.
	ValueTypeBool ValueType = "bool"

	// ValueTypeList is for lists of values.
	ValueTypeList ValueType = "list"

	// ValueTypeMap is for maps of values.
	ValueTypeMap ValueType = "map"

	// ValueTypeObject is for objects with a predefined
	// structure with known attributes.
	ValueTypeObject ValueType = "object"

	// ValueTypeFunction is for functions that can be passed
	// into and returned from other functions.
	ValueTypeFunction ValueType = "function"

	// ValueTypeAny is for a parameter or return value
	// that can have any type.
	ValueTypeAny ValueType = "any"
)

type ValueTypeDefinition

type ValueTypeDefinition interface {
	// GetType returns the type name of the value type definition.
	GetType() ValueType
	// GetLabel returns the name of the value type definition.
	GetLabel() string
	// GetDescription returns a human-readable description
	// of the value type definition.
	GetDescription() string
	// GetFormattedDescription returns a human-readable description
	// of the value type definition that is formatted with markdown.
	GetFormattedDescription() string
}

ValueTypeDefinition is an interface that provides a common interface for all value type definitions that can be used in parameter and return type definitions.

type ValueTypeDefinitionAny

type ValueTypeDefinitionAny struct {
	// Type is the value type name for an any type.
	Type ValueType
	// UnionTypes is a list of value type definitions that are allowed
	// for the value.
	// When provided, an any value type will be validated as a union type
	// where the return value must match one of the types in the union.
	UnionTypes []ValueTypeDefinition
	// Label is the usage name for the value type.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Description is a human-readable description of
	// the value type. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the value type that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ValueTypeDefinitionAny is a value type definition for an argument or return value that can have any type.

func (*ValueTypeDefinitionAny) GetDescription

func (v *ValueTypeDefinitionAny) GetDescription() string

func (*ValueTypeDefinitionAny) GetFormattedDescription

func (v *ValueTypeDefinitionAny) GetFormattedDescription() string

func (*ValueTypeDefinitionAny) GetLabel

func (v *ValueTypeDefinitionAny) GetLabel() string

func (*ValueTypeDefinitionAny) GetType

func (v *ValueTypeDefinitionAny) GetType() ValueType

type ValueTypeDefinitionFunction

type ValueTypeDefinitionFunction struct {
	// Definition is the function definition that describes the
	// parameters and return type of an anonymous function
	// that can be passed into and returned from other functions.
	Definition Definition
	// Label is the usage name for the value type.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Description is a human-readable description of
	// the value type. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the value type that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ValueTypeDefinitionFunction is a value type definition for a function that can be passed into and returned from other functions.

func (*ValueTypeDefinitionFunction) GetDescription

func (v *ValueTypeDefinitionFunction) GetDescription() string

func (*ValueTypeDefinitionFunction) GetFormattedDescription

func (v *ValueTypeDefinitionFunction) GetFormattedDescription() string

func (*ValueTypeDefinitionFunction) GetLabel

func (v *ValueTypeDefinitionFunction) GetLabel() string

func (*ValueTypeDefinitionFunction) GetType

type ValueTypeDefinitionList

type ValueTypeDefinitionList struct {
	// ElementType is the type definition for the elements in the list.
	ElementType ValueTypeDefinition
	// Label is the usage name for the value type.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Description is a human-readable description of
	// the value type. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the value type that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ValueTypeDefinitionList is a value type definition for lists of values.

func (*ValueTypeDefinitionList) GetDescription

func (v *ValueTypeDefinitionList) GetDescription() string

func (*ValueTypeDefinitionList) GetFormattedDescription

func (v *ValueTypeDefinitionList) GetFormattedDescription() string

func (*ValueTypeDefinitionList) GetLabel

func (v *ValueTypeDefinitionList) GetLabel() string

func (*ValueTypeDefinitionList) GetType

func (v *ValueTypeDefinitionList) GetType() ValueType

type ValueTypeDefinitionMap

type ValueTypeDefinitionMap struct {
	// ElementType is the type definition for the values in the map.
	ElementType ValueTypeDefinition
	// Label is the usage name for the value type.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Description is a human-readable description of
	// the value type. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the value type that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
}

ValueTypeDefinitionMap is a value type definition for a mapping of strings to values.

func (*ValueTypeDefinitionMap) GetDescription

func (v *ValueTypeDefinitionMap) GetDescription() string

func (*ValueTypeDefinitionMap) GetFormattedDescription

func (v *ValueTypeDefinitionMap) GetFormattedDescription() string

func (*ValueTypeDefinitionMap) GetLabel

func (v *ValueTypeDefinitionMap) GetLabel() string

func (*ValueTypeDefinitionMap) GetType

func (v *ValueTypeDefinitionMap) GetType() ValueType

type ValueTypeDefinitionObject

type ValueTypeDefinitionObject struct {
	// AttributeTypes is a map of attribute names to attribute types.
	AttributeTypes map[string]AttributeType
	// Label is the usage name for the value type.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Description is a human-readable description of
	// the value type. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the value type that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// Required is a list of attribute names that are required
	// for the object.
	Required []string
}

ValueTypeDefinitionObject is a value type definition for a predefined object structure with known attributes.

func (*ValueTypeDefinitionObject) GetDescription

func (v *ValueTypeDefinitionObject) GetDescription() string

func (*ValueTypeDefinitionObject) GetFormattedDescription

func (v *ValueTypeDefinitionObject) GetFormattedDescription() string

func (*ValueTypeDefinitionObject) GetLabel

func (v *ValueTypeDefinitionObject) GetLabel() string

func (*ValueTypeDefinitionObject) GetType

func (v *ValueTypeDefinitionObject) GetType() ValueType

type ValueTypeDefinitionScalar

type ValueTypeDefinitionScalar struct {
	// Type is the value type name for the scalar type.
	Type ValueType
	// Label is the usage name for the value type.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Description is a human-readable description of
	// the value type. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the value type that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// StringChoices is a list of string values that are allowed
	// for the value.
	// This is only taken into account when typeDef.Type is ValueTypeString.
	StringChoices []string
}

ValueTypeDefinitionScalar is a value type definition for scalar (primitive) types.

func (*ValueTypeDefinitionScalar) GetDescription

func (v *ValueTypeDefinitionScalar) GetDescription() string

func (*ValueTypeDefinitionScalar) GetFormattedDescription

func (v *ValueTypeDefinitionScalar) GetFormattedDescription() string

func (*ValueTypeDefinitionScalar) GetLabel

func (v *ValueTypeDefinitionScalar) GetLabel() string

func (*ValueTypeDefinitionScalar) GetType

func (v *ValueTypeDefinitionScalar) GetType() ValueType

type VariadicParameter

type VariadicParameter struct {
	// Label is the usage name for the parameter.
	// This will appear in logs and in tooling such as
	// the language server.
	Label string
	// Type of the parameters, each argument will be validated
	// against this type.
	Type ValueTypeDefinition
	// SingleType determines whether or not the variadic parameters
	// must all be of the same type.
	// This is false by default, meaning that variadic parameters
	// can be of any type.
	// The Type field is only assessed if SingleType is true.
	SingleType bool
	// Description is a human-readable description of
	// the parameter. This will appear in logs and in
	// tooling such as the language server.
	Description string
	// FormattedDescription is a human-readable description of
	// the parameter that is formatted with markdown.
	// This will appear in usage documentation, logs and in
	// tooling such as the language server.
	FormattedDescription string
	// AllowNullValue determines whether or not an argument
	// passed in for these parameters can be null.
	AllowNullValue bool
	// Named determines whether or not the variadic parameters
	// are named arguments.
	// Named and positional arguments cannot be mixed.
	// If they are named arguments, all arguments do not need to be
	// of the same type.
	Named bool
}

VariadicParameter is a parameter type definition for variadic parameters at the end of a parameter list. A variadic parameter can be any number of arguments of any or a specific type.

func (*VariadicParameter) GetAllowNullValue

func (p *VariadicParameter) GetAllowNullValue() bool

func (*VariadicParameter) GetDescription

func (p *VariadicParameter) GetDescription() string

func (*VariadicParameter) GetFormattedDescription

func (p *VariadicParameter) GetFormattedDescription() string

func (*VariadicParameter) GetLabel

func (p *VariadicParameter) GetLabel() string

func (*VariadicParameter) GetName

func (p *VariadicParameter) GetName() string

func (*VariadicParameter) GetOptional

func (p *VariadicParameter) GetOptional() bool

func (*VariadicParameter) GetType

func (p *VariadicParameter) GetType() ValueType

Jump to

Keyboard shortcuts

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