Documentation ¶
Index ¶
- Constants
- type PoolFunc
- func (obj *PoolFunc) ArgGen(index int) (string, error)
- func (obj *PoolFunc) Call(ctx context.Context, input []types.Value) (types.Value, error)
- func (obj *PoolFunc) Info() *interfaces.Info
- func (obj *PoolFunc) Init(init *interfaces.Init) error
- func (obj *PoolFunc) SetData(data *interfaces.FuncData)
- func (obj *PoolFunc) Stream(ctx context.Context) error
- func (obj *PoolFunc) String() string
- func (obj *PoolFunc) Validate() error
- type VarDirFunc
- func (obj *VarDirFunc) ArgGen(index int) (string, error)
- func (obj *VarDirFunc) Call(ctx context.Context, input []types.Value) (types.Value, error)
- func (obj *VarDirFunc) Info() *interfaces.Info
- func (obj *VarDirFunc) Init(init *interfaces.Init) error
- func (obj *VarDirFunc) SetData(data *interfaces.FuncData)
- func (obj *VarDirFunc) Stream(ctx context.Context) error
- func (obj *VarDirFunc) String() string
- func (obj *VarDirFunc) Validate() error
Constants ¶
const ( // VarDirFunctionsPrefix is the prefix we prepend to any VarDir path // request, so that if the local.VarDir API is used elsewhere, it // doesn't conflict with what we're doing here. VarDirFunctionsPrefix = "functions/" // VarDirFuncName is the name this function is registered as. VarDirFuncName = "vardir" )
const (
// ModuleName is the prefix given to all the functions in this module.
ModuleName = "local"
)
const (
// PoolFuncName is the name this function is registered as.
PoolFuncName = "pool"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PoolFunc ¶
type PoolFunc struct {
// contains filtered or unexported fields
}
PoolFunc is a function that returns a unique integer from a pool of numbers. Within a given namespace, it returns the same integer for a given name. It is a simple mechanism to allocate numbers to different inputs when we don't have a hashing alternative. It does not allocate zero.
func (*PoolFunc) Call ¶
Call this function with the input args and return the value if it is possible to do so at this time.
func (*PoolFunc) Info ¶
func (obj *PoolFunc) Info() *interfaces.Info
Info returns some static info about itself.
func (*PoolFunc) Init ¶
func (obj *PoolFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.
func (*PoolFunc) SetData ¶
func (obj *PoolFunc) SetData(data *interfaces.FuncData)
SetData is used by the language to pass our function some code-level context.
type VarDirFunc ¶
type VarDirFunc struct {
// contains filtered or unexported fields
}
VarDirFunc is a function that returns the absolute, full path in the deploy from an input path that is relative to the calling file. If you pass it an empty string, you'll just get the absolute deploy directory path that you're in.
func (*VarDirFunc) ArgGen ¶
func (obj *VarDirFunc) ArgGen(index int) (string, error)
ArgGen returns the Nth arg name for this function.
func (*VarDirFunc) Call ¶
Call this function with the input args and return the value if it is possible to do so at this time.
func (*VarDirFunc) Info ¶
func (obj *VarDirFunc) Info() *interfaces.Info
Info returns some static info about itself.
func (*VarDirFunc) Init ¶
func (obj *VarDirFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.
func (*VarDirFunc) SetData ¶
func (obj *VarDirFunc) SetData(data *interfaces.FuncData)
SetData is used by the language to pass our function some code-level context.
func (*VarDirFunc) Stream ¶
func (obj *VarDirFunc) Stream(ctx context.Context) error
Stream returns the changing values that this func has over time.
func (*VarDirFunc) String ¶
func (obj *VarDirFunc) String() string
String returns a simple name for this function. This is needed so this struct can satisfy the pgraph.Vertex interface.
func (*VarDirFunc) Validate ¶
func (obj *VarDirFunc) Validate() error
Validate makes sure we've built our struct properly. It is usually unused for normal functions that users can use directly.