package coreworld
import "github.com/purpleidea/mgmt/lang/core/world"
Index ¶
- Constants
- type ExchangeFunc
- func (obj *ExchangeFunc) ArgGen(index int) (string, error)
- func (obj *ExchangeFunc) Info() *interfaces.Info
- func (obj *ExchangeFunc) Init(init *interfaces.Init) error
- func (obj *ExchangeFunc) Stream(ctx context.Context) error
- func (obj *ExchangeFunc) String() string
- func (obj *ExchangeFunc) Validate() error
- type GetValFunc
- func (obj *GetValFunc) ArgGen(index int) (string, error)
- func (obj *GetValFunc) Call(ctx context.Context, args []types.Value) (types.Value, error)
- func (obj *GetValFunc) Info() *interfaces.Info
- func (obj *GetValFunc) Init(init *interfaces.Init) error
- func (obj *GetValFunc) Stream(ctx context.Context) error
- func (obj *GetValFunc) String() string
- func (obj *GetValFunc) Validate() error
- type KVLookupFunc
- func (obj *KVLookupFunc) ArgGen(index int) (string, error)
- func (obj *KVLookupFunc) Call(ctx context.Context, args []types.Value) (types.Value, error)
- func (obj *KVLookupFunc) Info() *interfaces.Info
- func (obj *KVLookupFunc) Init(init *interfaces.Init) error
- func (obj *KVLookupFunc) Stream(ctx context.Context) error
- func (obj *KVLookupFunc) String() string
- func (obj *KVLookupFunc) Validate() error
- type ScheduleFunc
- func (obj *ScheduleFunc) ArgGen(index int) (string, error)
- func (obj *ScheduleFunc) Build(typ *types.Type) (*types.Type, error)
- func (obj *ScheduleFunc) FuncInfer(partialType *types.Type, partialValues []types.Value) (*types.Type, []*interfaces.UnificationInvariant, error)
- func (obj *ScheduleFunc) Info() *interfaces.Info
- func (obj *ScheduleFunc) Init(init *interfaces.Init) error
- func (obj *ScheduleFunc) Stream(ctx context.Context) error
- func (obj *ScheduleFunc) String() string
- func (obj *ScheduleFunc) Validate() error
Constants ¶
const ( // ScheduleFuncName is the name this function is registered as. ScheduleFuncName = "schedule" // DefaultStrategy is the strategy to use if none has been specified. DefaultStrategy = "rr" // StrictScheduleOpts specifies whether the opts passed into the // scheduler must be strictly what we're expecting, and nothing more. // If this was false, then we'd allow an opts struct that had a field // that wasn't used by the scheduler. This could be useful if we need to // migrate to a newer version of the function. It's probably best to // keep this strict. StrictScheduleOpts = true )
const ( // ExchangeFuncName is the name this function is registered as. ExchangeFuncName = "exchange" )
const ( // GetValFuncName is the name this function is registered as. GetValFuncName = "getval" )
const ( // KVLookupFuncName is the name this function is registered as. KVLookupFuncName = "kvlookup" )
const ( // ModuleName is the prefix given to all the functions in this module. ModuleName = "world" )
Types ¶
type ExchangeFunc ¶
type ExchangeFunc struct {
// contains filtered or unexported fields
}
ExchangeFunc is special function which returns all the values of a given key in the exposed world, and sets it's own.
func (*ExchangeFunc) ArgGen ¶
func (obj *ExchangeFunc) ArgGen(index int) (string, error)
ArgGen returns the Nth arg name for this function.
func (*ExchangeFunc) Info ¶
func (obj *ExchangeFunc) Info() *interfaces.Info
Info returns some static info about itself.
func (*ExchangeFunc) Init ¶
func (obj *ExchangeFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.
func (*ExchangeFunc) Stream ¶
func (obj *ExchangeFunc) Stream(ctx context.Context) error
Stream returns the changing values that this func has over time.
func (*ExchangeFunc) String ¶
func (obj *ExchangeFunc) String() string
String returns a simple name for this function. This is needed so this struct can satisfy the pgraph.Vertex interface.
func (*ExchangeFunc) Validate ¶
func (obj *ExchangeFunc) Validate() error
Validate makes sure we've built our struct properly. It is usually unused for normal functions that users can use directly.
type GetValFunc ¶
type GetValFunc struct {
// contains filtered or unexported fields
}
GetValFunc is special function which returns the value of a given key in the exposed world.
func (*GetValFunc) ArgGen ¶
func (obj *GetValFunc) ArgGen(index int) (string, error)
ArgGen returns the Nth arg name for this function.
func (*GetValFunc) Call ¶
Call this function with the input args and return the value if it is possible to do so at this time. This was previously getValue which gets the value we're looking for.
func (*GetValFunc) Info ¶
func (obj *GetValFunc) Info() *interfaces.Info
Info returns some static info about itself.
func (*GetValFunc) Init ¶
func (obj *GetValFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.
func (*GetValFunc) Stream ¶
func (obj *GetValFunc) Stream(ctx context.Context) error
Stream returns the changing values that this func has over time.
func (*GetValFunc) String ¶
func (obj *GetValFunc) String() string
String returns a simple name for this function. This is needed so this struct can satisfy the pgraph.Vertex interface.
func (*GetValFunc) Validate ¶
func (obj *GetValFunc) Validate() error
Validate makes sure we've built our struct properly. It is usually unused for normal functions that users can use directly.
type KVLookupFunc ¶
type KVLookupFunc struct {
// contains filtered or unexported fields
}
KVLookupFunc is special function which returns all the values of a given key in the exposed world. It is similar to exchange, but it does not set a key.
func (*KVLookupFunc) ArgGen ¶
func (obj *KVLookupFunc) ArgGen(index int) (string, error)
ArgGen returns the Nth arg name for this function.
func (*KVLookupFunc) Call ¶
Call this function with the input args and return the value if it is possible to do so at this time. This was previously buildMap, which builds the result map which we'll need. It uses struct variables.
func (*KVLookupFunc) Info ¶
func (obj *KVLookupFunc) Info() *interfaces.Info
Info returns some static info about itself.
func (*KVLookupFunc) Init ¶
func (obj *KVLookupFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.
func (*KVLookupFunc) Stream ¶
func (obj *KVLookupFunc) Stream(ctx context.Context) error
Stream returns the changing values that this func has over time.
func (*KVLookupFunc) String ¶
func (obj *KVLookupFunc) String() string
String returns a simple name for this function. This is needed so this struct can satisfy the pgraph.Vertex interface.
func (*KVLookupFunc) Validate ¶
func (obj *KVLookupFunc) Validate() error
Validate makes sure we've built our struct properly. It is usually unused for normal functions that users can use directly.
type ScheduleFunc ¶
type ScheduleFunc struct { Type *types.Type // this is the type of opts used if specified // contains filtered or unexported fields }
ScheduleFunc is special function which determines where code should run in the cluster.
func (*ScheduleFunc) ArgGen ¶
func (obj *ScheduleFunc) ArgGen(index int) (string, error)
ArgGen returns the Nth arg name for this function.
func (*ScheduleFunc) 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 (*ScheduleFunc) FuncInfer ¶
func (obj *ScheduleFunc) FuncInfer(partialType *types.Type, partialValues []types.Value) (*types.Type, []*interfaces.UnificationInvariant, error)
FuncInfer takes partial type and value information from the call site of this function so that it can build an appropriate type signature for it. The type signature may include unification variables.
func (*ScheduleFunc) Info ¶
func (obj *ScheduleFunc) Info() *interfaces.Info
Info returns some static info about itself. Build must be called before this will return correct data.
func (*ScheduleFunc) Init ¶
func (obj *ScheduleFunc) Init(init *interfaces.Init) error
Init runs some startup code for this function.
func (*ScheduleFunc) Stream ¶
func (obj *ScheduleFunc) Stream(ctx context.Context) error
Stream returns the changing values that this func has over time.
func (*ScheduleFunc) String ¶
func (obj *ScheduleFunc) String() string
String returns a simple name for this function. This is needed so this struct can satisfy the pgraph.Vertex interface.
func (*ScheduleFunc) Validate ¶
func (obj *ScheduleFunc) Validate() error
Validate tells us if the input struct takes a valid form.
Source Files ¶
exchange.go getval.go kvlookup.go schedule.go world.go
- Version
- v0.0.0-20250322185616-c50a578426f1 (latest)
- Published
- Mar 22, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 4 days ago –
Tools for package owners.