Documentation ¶
Index ¶
- func Invoke[T any](f func(args *Arguments) (T, error), argsObj values.Object) (T, error)
- func InvokeContext[T any](f func(ctx context.Context, args *Arguments) (T, error), ctx context.Context, ...) (T, error)
- type Arguments
- func (a *Arguments) Get(name string) (values.Value, bool)
- func (a *Arguments) GetArray(name string, t semantic.Nature) (values.Array, bool, error)
- func (a *Arguments) GetArrayAllowEmpty(name string, t semantic.Nature) (values.Array, bool, error)
- func (a *Arguments) GetBool(name string) (bool, bool, error)
- func (a *Arguments) GetDictionary(name string) (values.Dictionary, bool, error)
- func (a *Arguments) GetDuration(name string) (flux.Duration, bool, error)
- func (a *Arguments) GetFloat(name string) (float64, bool, error)
- func (a *Arguments) GetFunction(name string) (values.Function, bool, error)
- func (a *Arguments) GetInt(name string) (int64, bool, error)
- func (a *Arguments) GetObject(name string) (values.Object, bool, error)
- func (a *Arguments) GetRequired(name string) (values.Value, error)
- func (a *Arguments) GetRequiredArray(name string, t semantic.Nature) (values.Array, error)
- func (a *Arguments) GetRequiredArrayAllowEmpty(name string, t semantic.Nature) (values.Array, error)
- func (a *Arguments) GetRequiredBool(name string) (bool, error)
- func (a *Arguments) GetRequiredDictionary(name string) (values.Dictionary, error)
- func (a *Arguments) GetRequiredDuration(name string) (flux.Duration, error)
- func (a *Arguments) GetRequiredFloat(name string) (float64, error)
- func (a *Arguments) GetRequiredFunction(name string) (values.Function, error)
- func (a *Arguments) GetRequiredInt(name string) (int64, error)
- func (a *Arguments) GetRequiredObject(name string) (values.Object, error)
- func (a *Arguments) GetRequiredString(name string) (string, error)
- func (a *Arguments) GetRequiredTime(name string) (flux.Time, error)
- func (a *Arguments) GetRequiredUInt(name string) (uint64, error)
- func (a *Arguments) GetString(name string) (string, bool, error)
- func (a *Arguments) GetTime(name string) (flux.Time, bool, error)
- func (a *Arguments) GetUInt(name string) (uint64, bool, error)
- type Builder
- func (b Builder) Register(name string, fn Definition)
- func (b Builder) RegisterContext(name string, fn DefinitionContext)
- func (b Builder) RegisterSource(name string, kind plan.ProcedureKind, fn SourceDefinition)
- func (b Builder) RegisterTransformation(name string, kind plan.ProcedureKind, fn TransformationDefinition)
- type Definition
- type DefinitionContext
- type Source
- type SourceDefinition
- type Transformation
- type TransformationDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Invoke ¶ added in v0.181.0
Invoke calls a function and returns the result.
This is the same as InvokeContext but with a background context.
func InvokeContext ¶ added in v0.181.0
func InvokeContext[T any](f func(ctx context.Context, args *Arguments) (T, error), ctx context.Context, argsObj values.Object) (T, error)
InvokeContext calls a function and returns the result.
It passes the object as the arguments to the function and returns an error if any supplied arguments are not used.
Types ¶
type Arguments ¶ added in v0.181.0
type Arguments struct {
// contains filtered or unexported fields
}
Arguments provides access to the arguments of a function call. This struct can only be created by using one of the Register functions to register a function or by directly calling Invoke.
func (*Arguments) GetArrayAllowEmpty ¶ added in v0.181.0
func (*Arguments) GetDictionary ¶ added in v0.181.0
func (*Arguments) GetDuration ¶ added in v0.181.0
func (*Arguments) GetFunction ¶ added in v0.181.0
func (*Arguments) GetRequired ¶ added in v0.181.0
func (*Arguments) GetRequiredArray ¶ added in v0.181.0
func (*Arguments) GetRequiredArrayAllowEmpty ¶ added in v0.181.0
func (a *Arguments) GetRequiredArrayAllowEmpty(name string, t semantic.Nature) (values.Array, error)
GetRequiredArrayAllowEmpty ensures a required array (with element type) is present, but unlike GetRequiredArray, does not fail if the array is empty.
func (*Arguments) GetRequiredBool ¶ added in v0.181.0
func (*Arguments) GetRequiredDictionary ¶ added in v0.181.0
func (a *Arguments) GetRequiredDictionary(name string) (values.Dictionary, error)
func (*Arguments) GetRequiredDuration ¶ added in v0.181.0
func (*Arguments) GetRequiredFloat ¶ added in v0.181.0
func (*Arguments) GetRequiredFunction ¶ added in v0.181.0
func (*Arguments) GetRequiredInt ¶ added in v0.181.0
func (*Arguments) GetRequiredObject ¶ added in v0.181.0
func (*Arguments) GetRequiredString ¶ added in v0.181.0
func (*Arguments) GetRequiredTime ¶ added in v0.181.0
func (*Arguments) GetRequiredUInt ¶ added in v0.181.0
type Builder ¶
type Builder struct {
PackagePath string
}
func ForPackage ¶
func (Builder) Register ¶
func (b Builder) Register(name string, fn Definition)
func (Builder) RegisterContext ¶ added in v0.167.0
func (b Builder) RegisterContext(name string, fn DefinitionContext)
func (Builder) RegisterSource ¶ added in v0.182.0
func (b Builder) RegisterSource(name string, kind plan.ProcedureKind, fn SourceDefinition)
func (Builder) RegisterTransformation ¶ added in v0.182.0
func (b Builder) RegisterTransformation(name string, kind plan.ProcedureKind, fn TransformationDefinition)
type DefinitionContext ¶ added in v0.167.0
type Source ¶ added in v0.182.0
type Source interface { plan.ProcedureSpec CreateSource(id execute.DatasetID, a execute.Administration) (execute.Source, error) }
type SourceDefinition ¶ added in v0.182.0
type Transformation ¶ added in v0.182.0
type Transformation interface { plan.ProcedureSpec CreateTransformation(id execute.DatasetID, a execute.Administration) (execute.Transformation, execute.Dataset, error) }
type TransformationDefinition ¶ added in v0.182.0
type TransformationDefinition func(args *Arguments) (Transformation, error)
Click to show internal directories.
Click to hide internal directories.