Documentation ¶
Index ¶
- Constants
- type GetFunc
- func (obj *GetFunc) ArgGen(index int) (string, error)
- func (obj *GetFunc) Build(typ *types.Type) (*types.Type, error)
- func (obj *GetFunc) Info() *interfaces.Info
- func (obj *GetFunc) Init(init *interfaces.Init) error
- func (obj *GetFunc) Stream(ctx context.Context) error
- func (obj *GetFunc) String() string
- func (obj *GetFunc) Validate() error
Constants ¶
const ( // GetFuncName is the name this function is registered as. This variant // is the fanciest version, although type unification is much more // difficult when using this. // XXX: type unification doesn't work perfectly here yet... maybe a bug with returned structs? GetFuncName = "get" // GetBoolFuncName is the name this function is registered as. This // variant can only pull in values of type bool. GetBoolFuncName = "get_bool" // GetStrFuncName is the name this function is registered as. This // variant can only pull in values of type str. GetStrFuncName = "get_str" // GetIntFuncName is the name this function is registered as. This // variant can only pull in values of type int. GetIntFuncName = "get_int" // GetFloatFuncName is the name this function is registered as. This // variant can only pull in values of type float. GetFloatFuncName = "get_float" )
const (
// ModuleName is the prefix given to all the functions in this module.
ModuleName = "value"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetFunc ¶
type GetFunc struct { // Type is the actual type being used for the value we are looking up. Type *types.Type // contains filtered or unexported fields }
GetFunc is special function which looks up the stored `Any` field in the value resource that it gets it from. If it is initialized with a fixed Type field, then it becomes a statically typed version that can only return keys of that type. It is instead recommended to use the Get* functions that are more strictly typed.
func (*GetFunc) Build ¶
Build is run to turn the polymorphic, undetermined function, into the specific statically typed version. It is usually run after Unify completes, and must be run before Info() and any of the other Func interface methods are used. This function is idempotent, as long as the arg isn't changed between runs.
func (*GetFunc) Info ¶
func (obj *GetFunc) Info() *interfaces.Info
Info returns some static info about itself.
func (*GetFunc) Init ¶
func (obj *GetFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.