forge_target

package
v0.51.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTargetWorldUnset is returned if no target world was set.
	ErrTargetWorldUnset = errors.New("no target world configured")
	// ErrUnknownInputType is returned if the input type is unknown.
	ErrUnknownInputType = errors.New("unknown input type")
	// ErrUnknownOutputType is returned if the output type is unknown.
	ErrUnknownOutputType = errors.New("unknown output type")
	// ErrUnexpectedInputValueType is returned if the input value type was unexpected.
	ErrUnexpectedInputValueType = errors.New("unexpected input value type")
	// ErrUnexpectedOutputValueType is returned if the output value type was unexpected.
	ErrUnexpectedOutputValueType = errors.New("unexpected output value type")
)
View Source
var (
	InputType_name = map[int32]string{
		0: "InputType_UNKNOWN",
		1: "InputType_VALUE",
		2: "InputType_ALIAS",
		3: "InputType_WORLD",
		4: "InputType_WORLD_OBJECT",
	}
	InputType_value = map[string]int32{
		"InputType_UNKNOWN":      0,
		"InputType_VALUE":        1,
		"InputType_ALIAS":        2,
		"InputType_WORLD":        3,
		"InputType_WORLD_OBJECT": 4,
	}
)

Enum value maps for InputType.

View Source
var (
	OutputType_name = map[int32]string{
		0: "OutputType_UNKNOWN",
		1: "OutputType_EXEC",
		2: "OutputType_VALUE",
	}
	OutputType_value = map[string]int32{
		"OutputType_UNKNOWN": 0,
		"OutputType_EXEC":    1,
		"OutputType_VALUE":   2,
	}
)

Enum value maps for OutputType.

Functions

func AccessObject

func AccessObject(
	ctx context.Context,
	handle ExecControllerHandle,
	ref *bucket.ObjectRef,
	cb func(*block.Cursor) error,
) (*bucket.ObjectRef, error)

AccessObject creates a block cursor at a object value.

func AccessValue

func AccessValue(
	ctx context.Context,
	handle ExecControllerHandle,
	val *forge_value.Value,
	cb func(*block.Cursor) error,
) (*forge_value.Value, error)

AccessValue accesses object located at value and returns a new value with the updated result, or a clone of the original if nothing changed.

Value can be nil (or the ref empty) to create a new value.

func ComputeOutput

func ComputeOutput(output *Output, execValues []*forge_value.Value) (*forge_value.Value, error)

ComputeOutput computes the output value for a Execution output value.

returns an empty value (Type=0) for any unset outputs.

func ComputeOutputs

func ComputeOutputs(outputs []*Output, execValues []*forge_value.Value) (forge_value.ValueSlice, error)

ComputeOutputs computes the output set for a list of Execution output values.

func CopyValueToBucket

func CopyValueToBucket(
	ctx context.Context,
	handle ExecControllerHandle,
	val *forge_value.Value,
) (*forge_value.Value, error)

CopyValueToBucket copies the value to the target bucket.

May return nil if there is no value set or if it is empty. Otherwise returns a *Value with type BLOCK_REF or an error.

func CreateTarget

func CreateTarget(
	ctx context.Context,
	ws world.WorldState,
	objKey string, t *Target,
) (world.ObjectState, *bucket.ObjectRef, error)

CreateTarget writes the Target to a world object.

func GetInputsNames

func GetInputsNames(inps []*Input) []string

GetInputsNames returns the list of names for a set of inputs.

func InlineValueToValue

func InlineValueToValue(iv InputValue) (*forge_value.Value, error)

InlineValueToValue resolves an inline InputValue to a Value. Does not attempt to resolve dynamic values. Returns nil, nil if the value is empty or nil.

func InputValueToValue

func InputValueToValue(iv InputValue) (*forge_value.Value, error)

InputValueToValue resolves an inline InputValue to a Value. Returns nil, nil if the value is empty or nil.

func InputValueToWorldState

func InputValueToWorldState(iv InputValue) (world.WorldState, error)

InputValueToWorldState resolves an InputValue to a WorldState. Returns nil, nil if the value is empty or nil.

func LoadBlobValueToBytes

func LoadBlobValueToBytes(
	ctx context.Context,
	handle ExecControllerHandle,
	val *forge_value.Value,
) ([]byte, error)

LoadBlobValueToBytes loads the blob value to a byte slice.

func LoadMsgpackValue

func LoadMsgpackValue[T any](
	ctx context.Context,
	handle ExecControllerHandle,
	value *forge_value.Value,
	ctor func() T,
) (T, error)

LoadMsgpackValue loads the data from a msgpack block. use interface{} type to unmarshal dynamic types. if ctor is nil, uses the empty value of T. returns the empty value returned from ctor if value is empty StoreMsgpackValue stores the given data as a Msgpack block.

func NewTargetBlock

func NewTargetBlock() block.Block

NewTargetBlock constructs a new block with type Target.

func NewValueSetBlock

func NewValueSetBlock() block.Block

NewValueSetBlock constructs a new value set block.

func NewValueSetSubBlockCtor

func NewValueSetSubBlockCtor(r **ValueSet) block.SubBlockCtor

NewValueSetSubBlockCtor returns the sub-block constructor.

func ResolveInputMap

func ResolveInputMap(
	ctx context.Context,
	b bus.Bus,
	defWorld InputValueWorld,
	tgt *Target,
	inputVals forge_value.ValueMap,
) (im InputMap, unresolved []*Input, relAll func(), err error)

ResolveInputMap resolves a ValueMap to an InputMap. returns a function which can be used to release the values. inputVals is the contents of the inputs ValueSet. returns the list of unresolved inputs.

func SortInputs

func SortInputs(inps []*Input)

SortInputs sorts the inputs slice by name.

func StoreBlobValue

func StoreBlobValue(
	ctx context.Context,
	handle ExecControllerHandle,
	dataLen int64,
	rd io.Reader,
) (*forge_value.Value, error)

StoreBlobValue stores the given data as a Blob and returns a BlockRef value.

func StoreBlobValueFromBytes

func StoreBlobValueFromBytes(
	ctx context.Context,
	handle ExecControllerHandle,
	data []byte,
) (*forge_value.Value, error)

StoreBlobValueFromBytes stores the given []byte slice as a Blob value.

func StoreMsgpackValue

func StoreMsgpackValue(
	ctx context.Context,
	handle ExecControllerHandle,
	value any,
) (*forge_value.Value, error)

StoreMsgpackValue stores the given data as a Msgpack block. The data is all stored in a single block.

func StoreValueAsBlockRef

func StoreValueAsBlockRef(
	ctx context.Context,
	handle ExecControllerHandle,
	val *forge_value.Value,
) (*forge_value.Value, error)

StoreValueAsBlockRef copies the value to a BlockRef. Copies data into the state bucket if it is located in a different bucket.

May return nil if there is no value set or if it is empty. Otherwise returns a *Value with type BLOCK_REF or an error.

Types

type Exec

type Exec struct {

	// Disable is a flag to ignore the below contents and inhibit the exec step.
	Disable bool `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"`
	// Controller indicates to run a controllerbus controller.
	Controller *proto.ControllerConfig `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
	// contains filtered or unexported fields
}

Exec contains target execution configuration.

func (*Exec) CloneMessageVT

func (m *Exec) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Exec) CloneVT

func (m *Exec) CloneVT() *Exec

func (*Exec) EqualMessageVT

func (this *Exec) EqualMessageVT(thatMsg any) bool

func (*Exec) EqualVT

func (this *Exec) EqualVT(that *Exec) bool

func (*Exec) GetController

func (x *Exec) GetController() *proto.ControllerConfig

func (*Exec) GetDisable

func (x *Exec) GetDisable() bool

func (*Exec) IsNil

func (e *Exec) IsNil() bool

IsNil checks if the object is nil.

func (*Exec) MarshalBlock

func (e *Exec) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*Exec) MarshalJSON

func (x *Exec) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Exec to JSON.

func (*Exec) MarshalProtoJSON

func (x *Exec) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Exec message to JSON.

func (*Exec) MarshalProtoText

func (x *Exec) MarshalProtoText() string

func (*Exec) MarshalToSizedBufferVT

func (m *Exec) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Exec) MarshalToVT

func (m *Exec) MarshalToVT(dAtA []byte) (int, error)

func (*Exec) MarshalVT

func (m *Exec) MarshalVT() (dAtA []byte, err error)

func (*Exec) ProtoMessage

func (*Exec) ProtoMessage()

func (*Exec) Reset

func (x *Exec) Reset()

func (*Exec) SizeVT

func (m *Exec) SizeVT() (n int)

func (*Exec) String

func (x *Exec) String() string

func (*Exec) UnmarshalBlock

func (e *Exec) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*Exec) UnmarshalJSON

func (x *Exec) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Exec from JSON.

func (*Exec) UnmarshalProtoJSON

func (x *Exec) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Exec message from JSON.

func (*Exec) UnmarshalVT

func (m *Exec) UnmarshalVT(dAtA []byte) error

func (*Exec) Validate

func (e *Exec) Validate() error

Validate performs cursory validation of the Exec.

type ExecController

type ExecController interface {
	// Controller indicates this is a controllerbus controller.
	controller.Controller
	// InitForgeExecController initializes the Forge execution controller.
	// This is called before Execute().
	// Any error returned cancels execution of the controller.
	InitForgeExecController(
		ctx context.Context,
		inputs InputMap,
		handle ExecControllerHandle,
	) error
}

ExecController is a controller that implements the target Exec controller. The controller will be constructed using the exec.controller config.

type ExecControllerHandle

type ExecControllerHandle interface {
	// GetExecutionUniqueId returns a unique identifier for the execution pass.
	GetExecutionUniqueId() string
	// GetPeerId returns the peer id that this exec controller is operating as.
	GetPeerId() peer.ID
	// GetTimestamp returns the timestamp for the execution and all execution ops.
	// Cannot return nil. Do not edit this object.
	GetTimestamp() *timestamp.Timestamp
	// AccessStorage builds a bucket lookup cursor located at the given ref.
	// If the ref is empty, will produce a cursor at the root of the world.
	// The lookup cursor will be released after cb returns.
	AccessStorage(
		ctx context.Context,
		ref *bucket.ObjectRef,
		cb func(*bucket_lookup.Cursor) error,
	) error
	// SetOutputs changes the outputs according to the given ValueSlice.
	// Note: the slice contents will be copied before the call returns.
	// Note: each Value must be named.
	// Use the writeCursor to write output objects, then SetOutputs with the refs.
	// If clearOld is set, all old Output values will be cleared.
	// Returns context.Canceled if the handle ctx is canceled.
	SetOutputs(
		ctx context.Context,
		outps forge_value.ValueSlice,
		clearOld bool,
	) error
	// WriteLog appends log entries to the execution.
	// Each entry is a (level, message) pair. The timestamp is set automatically.
	// Returns context.Canceled if the handle ctx is canceled.
	WriteLog(ctx context.Context, level, message string) error
}

ExecControllerHandle is the handle passed to the exec controller during init. This contains functions that can be called during execution.

func ExecControllerHandleWithAccess

func ExecControllerHandleWithAccess(
	uniqueID string,
	peerID peer.ID,
	targetWorld world.Engine,
	accessFunc world.AccessWorldStateFunc,
	ts *timestamp.Timestamp,
) ExecControllerHandle

ExecControllerHandleWithAccess constructs an ExecControllerHandle which only implements AccessStorage.

type Input

type Input struct {

	// Name is the unique name of the input.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// InputType is the type of input.
	// If UNKNOWN and Alias is set, assumes ALIAS.
	InputType InputType `protobuf:"varint,2,opt,name=input_type,json=inputType,proto3" json:"inputType,omitempty"`
	// Alias is the name of the target aliased Input.
	Alias string `protobuf:"bytes,3,opt,name=alias,proto3" json:"alias,omitempty"`
	// WatchChanges will restart the Task if the Value changes.
	WatchChanges bool `protobuf:"varint,7,opt,name=watch_changes,json=watchChanges,proto3" json:"watchChanges,omitempty"`
	// Value is the in-line data for the value input type.
	// InputType_VALUE
	Value *value.Value `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	// World contains the args for the world input type.
	// InputType_WORLD
	World *InputWorld `protobuf:"bytes,5,opt,name=world,proto3" json:"world,omitempty"`
	// WorldObject contains the args for the world object input type.
	// Can be used for change detection: re-run Target when object changes.
	// InputType_WORLD_OBJECT
	WorldObject *InputWorldObject `protobuf:"bytes,6,opt,name=world_object,json=worldObject,proto3" json:"worldObject,omitempty"`
	// contains filtered or unexported fields
}

Input contains configuration for a Task target input.

func NewInput_World

func NewInput_World(engineID string) *Input

NewInput_World constructs a new Input for a World.

func (*Input) CloneMessageVT

func (m *Input) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Input) CloneVT

func (m *Input) CloneVT() *Input

func (*Input) EqualMessageVT

func (this *Input) EqualMessageVT(thatMsg any) bool

func (*Input) EqualVT

func (this *Input) EqualVT(that *Input) bool

func (*Input) GetAlias

func (x *Input) GetAlias() string

func (*Input) GetInputType

func (x *Input) GetInputType() InputType

func (*Input) GetName

func (x *Input) GetName() string

func (*Input) GetValue

func (x *Input) GetValue() *value.Value

func (*Input) GetWatchChanges

func (x *Input) GetWatchChanges() bool

func (*Input) GetWorld

func (x *Input) GetWorld() *InputWorld

func (*Input) GetWorldObject

func (x *Input) GetWorldObject() *InputWorldObject

func (*Input) IsNil

func (i *Input) IsNil() bool

IsNil checks if the object is nil.

func (*Input) MarshalJSON

func (x *Input) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Input to JSON.

func (*Input) MarshalProtoJSON

func (x *Input) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Input message to JSON.

func (*Input) MarshalProtoText

func (x *Input) MarshalProtoText() string

func (*Input) MarshalToSizedBufferVT

func (m *Input) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Input) MarshalToVT

func (m *Input) MarshalToVT(dAtA []byte) (int, error)

func (*Input) MarshalVT

func (m *Input) MarshalVT() (dAtA []byte, err error)

func (*Input) ProtoMessage

func (*Input) ProtoMessage()

func (*Input) Reset

func (x *Input) Reset()

func (*Input) SizeVT

func (m *Input) SizeVT() (n int)

func (*Input) String

func (x *Input) String() string

func (*Input) UnmarshalJSON

func (x *Input) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Input from JSON.

func (*Input) UnmarshalProtoJSON

func (x *Input) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Input message from JSON.

func (*Input) UnmarshalVT

func (m *Input) UnmarshalVT(dAtA []byte) error

func (*Input) Validate

func (i *Input) Validate() error

Validate validates the Input object.

type InputMap

type InputMap map[string]InputValue

InputMap is the set of provided input values. The key must match the input Name field.

func (InputMap) BuildValueSet

func (m InputMap) BuildValueSet() *ValueSet

BuildValueSet builds a ValueSet from all InlineValue inputs.

func (InputMap) Validate

func (m InputMap) Validate() error

Validate checks all values in the map.

type InputType

type InputType int32

InputType is the list of possible input types.

const (
	// InputType_UNKNOWN is the zero output type.
	InputType_InputType_UNKNOWN InputType = 0
	// InputType_VALUE is an in-line value input.
	InputType_InputType_VALUE InputType = 1
	// InputType_ALIAS aliases the input to another named input.
	InputType_InputType_ALIAS InputType = 2
	// InputType_WORLD passes a handle to a Hydra World as an input.
	InputType_InputType_WORLD InputType = 3
	// InputType_WORLD_OBJECT passes a Value with the latest Object ref and a
	// world object handle attached to a WORLD input.
	InputType_InputType_WORLD_OBJECT InputType = 4
)

func (InputType) Enum

func (x InputType) Enum() *InputType

func (InputType) MarshalJSON

func (x InputType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the InputType to JSON.

func (InputType) MarshalProtoJSON

func (x InputType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the InputType to JSON.

func (InputType) MarshalProtoText

func (x InputType) MarshalProtoText() string

func (InputType) MarshalText

func (x InputType) MarshalText() ([]byte, error)

MarshalText marshals the InputType to text.

func (InputType) String

func (x InputType) String() string

func (*InputType) UnmarshalJSON

func (x *InputType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the InputType from JSON.

func (*InputType) UnmarshalProtoJSON

func (x *InputType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the InputType from JSON.

func (*InputType) UnmarshalText

func (x *InputType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the InputType from text.

func (InputType) Validate

func (t InputType) Validate(allowUnknown bool) error

Validate validates the input type.

type InputValue

type InputValue interface {
	// GetInputType returns the input type of this value.
	GetInputType() InputType
	// Validate checks the input value.
	Validate() error
	// IsEmpty checks if the value is "empty."
	IsEmpty() bool
}

InputValue is the parsed and processed value of an Input.

func ResolveInput

func ResolveInput(
	ctx context.Context,
	b bus.Bus,
	inp *Input,
	im InputMap,
	defWorld InputValueWorld,
) (InputValue, func(), error)

ResolveInput resolves an input to the InputMap. can return an optional release func (or nil) can return nil, nil, nil if no value

type InputValueInline

type InputValueInline interface {
	// InputValue indicates this is an InputValue.
	InputValue
	// GetValue returns the value.
	GetValue() *forge_value.Value
}

InputValueInline is the interface expected for a InputValue of type VALUE.

func NewInputValueInline

func NewInputValueInline(v *forge_value.Value) InputValueInline

NewInputValueInline constructs a new InputValueInline from a Value.

type InputValueWorld

type InputValueWorld interface {
	// InputValue indicates this is an InputValue.
	InputValue
	// GetWorldEngine returns the world engine, if available.
	// May return nil if unavailable.
	GetWorldEngine() world.Engine
	// GetWorldState returns the world state.
	// Should not return nil.
	GetWorldState() world.WorldState
}

InputValueWorld is the interface expected for a InputValue of type WORLD.

func InputValueToWorld

func InputValueToWorld(iv InputValue) (InputValueWorld, error)

InputValueToWorld resolves an InputValue to a InputValueWorld.

func NewInputValueWorld

func NewInputValueWorld(eng world.Engine, ws world.WorldState) InputValueWorld

NewInputValueWorld constructs a new InputValueWorld with a world handle. eng can be nil

type InputValueWorldObject

type InputValueWorldObject interface {
	// InputValue indicates this is an InputValue.
	InputValue
	// InputValueInline is the latest object state value.
	InputValueInline
	// InputValueWorld is the value for the world the object was retrieved from.
	InputValueWorld
	// GetWorldObject returns the world object state handle.
	GetWorldObject() world.ObjectState
}

InputValueWorldObject is the interface expected for a InputValue of type WORLD_OBJECT.

func InputValueToWorldObject

func InputValueToWorldObject(iv InputValue) (InputValueWorldObject, error)

InputValueToWorldObject resolves an InputValue to a WorldObject. Returns nil, nil if the value is empty or nil.

func NewInputValueWorldObject

func NewInputValueWorldObject(
	inline InputValueInline,
	wrld InputValueWorld,
	objs world.ObjectState,
	err error,
) InputValueWorldObject

NewInputValueWorldObject constructs a new InputValueWorldObject with a reference value. eng can be nil if eng != nil and ws == nil, constructs a EngineWorldState for ws

type InputWorld

type InputWorld struct {

	// EngineId is the world engine ID to lookup.
	EngineId string `protobuf:"bytes,1,opt,name=engine_id,json=engineId,proto3" json:"engineId,omitempty"`
	// LookupImmediate indicates the execution controller should lookup and wait
	// for the world engine to be ready before starting execution. If false, the
	// execution controller will pass a BusEngine handle which will lookup the
	// engine lazily (on first request).
	LookupImmediate bool `protobuf:"varint,2,opt,name=lookup_immediate,json=lookupImmediate,proto3" json:"lookupImmediate,omitempty"`
	// contains filtered or unexported fields
}

InputWorld are args for the world input type. InputType_WORLD

func (*InputWorld) CloneMessageVT

func (m *InputWorld) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*InputWorld) CloneVT

func (m *InputWorld) CloneVT() *InputWorld

func (*InputWorld) EqualMessageVT

func (this *InputWorld) EqualMessageVT(thatMsg any) bool

func (*InputWorld) EqualVT

func (this *InputWorld) EqualVT(that *InputWorld) bool

func (*InputWorld) GetEngineId

func (x *InputWorld) GetEngineId() string

func (*InputWorld) GetLookupImmediate

func (x *InputWorld) GetLookupImmediate() bool

func (*InputWorld) MarshalJSON

func (x *InputWorld) MarshalJSON() ([]byte, error)

MarshalJSON marshals the InputWorld to JSON.

func (*InputWorld) MarshalProtoJSON

func (x *InputWorld) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the InputWorld message to JSON.

func (*InputWorld) MarshalProtoText

func (x *InputWorld) MarshalProtoText() string

func (*InputWorld) MarshalToSizedBufferVT

func (m *InputWorld) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*InputWorld) MarshalToVT

func (m *InputWorld) MarshalToVT(dAtA []byte) (int, error)

func (*InputWorld) MarshalVT

func (m *InputWorld) MarshalVT() (dAtA []byte, err error)

func (*InputWorld) ProtoMessage

func (*InputWorld) ProtoMessage()

func (*InputWorld) Reset

func (x *InputWorld) Reset()

func (*InputWorld) ResolveValue

func (i *InputWorld) ResolveValue(ctx context.Context, b bus.Bus) (InputValueWorld, func(), error)

ResolveValue resolves the InputWorld to a InputValueWorld.

if lookupImmediate is set, looks up the world engine immediately otherwise, uses a BusEngine to look up the world engine on-demand.

func (*InputWorld) SizeVT

func (m *InputWorld) SizeVT() (n int)

func (*InputWorld) String

func (x *InputWorld) String() string

func (*InputWorld) UnmarshalJSON

func (x *InputWorld) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the InputWorld from JSON.

func (*InputWorld) UnmarshalProtoJSON

func (x *InputWorld) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the InputWorld message from JSON.

func (*InputWorld) UnmarshalVT

func (m *InputWorld) UnmarshalVT(dAtA []byte) error

func (*InputWorld) Validate

func (i *InputWorld) Validate() error

Validate validates the input world object.

type InputWorldObject

type InputWorldObject struct {

	// World is the name of the world input to lookup on.
	// If unset, defaults to the Forge Job world.
	World string `protobuf:"bytes,1,opt,name=world,proto3" json:"world,omitempty"`
	// ObjectKey is the object key to lookup.
	ObjectKey string `protobuf:"bytes,2,opt,name=object_key,json=objectKey,proto3" json:"objectKey,omitempty"`
	// ObjectRev is the minimum object rev to wait for.
	// If set, waits for the object to exist.
	// If object_rev == 0, does not wait for the object to exist.
	ObjectRev uint64 `protobuf:"varint,3,opt,name=object_rev,json=objectRev,proto3" json:"objectRev,omitempty"`
	// contains filtered or unexported fields
}

InputWorldObject are args for the world object input type. InputType_WORLD_OBJECT

func (*InputWorldObject) CloneMessageVT

func (m *InputWorldObject) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*InputWorldObject) CloneVT

func (m *InputWorldObject) CloneVT() *InputWorldObject

func (*InputWorldObject) EqualMessageVT

func (this *InputWorldObject) EqualMessageVT(thatMsg any) bool

func (*InputWorldObject) EqualVT

func (this *InputWorldObject) EqualVT(that *InputWorldObject) bool

func (*InputWorldObject) GetObjectKey

func (x *InputWorldObject) GetObjectKey() string

func (*InputWorldObject) GetObjectRev

func (x *InputWorldObject) GetObjectRev() uint64

func (*InputWorldObject) GetWorld

func (x *InputWorldObject) GetWorld() string

func (*InputWorldObject) MarshalJSON

func (x *InputWorldObject) MarshalJSON() ([]byte, error)

MarshalJSON marshals the InputWorldObject to JSON.

func (*InputWorldObject) MarshalProtoJSON

func (x *InputWorldObject) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the InputWorldObject message to JSON.

func (*InputWorldObject) MarshalProtoText

func (x *InputWorldObject) MarshalProtoText() string

func (*InputWorldObject) MarshalToSizedBufferVT

func (m *InputWorldObject) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*InputWorldObject) MarshalToVT

func (m *InputWorldObject) MarshalToVT(dAtA []byte) (int, error)

func (*InputWorldObject) MarshalVT

func (m *InputWorldObject) MarshalVT() (dAtA []byte, err error)

func (*InputWorldObject) ProtoMessage

func (*InputWorldObject) ProtoMessage()

func (*InputWorldObject) Reset

func (x *InputWorldObject) Reset()

func (*InputWorldObject) ResolveValue

func (i *InputWorldObject) ResolveValue(
	ctx context.Context,
	b bus.Bus,
	inpName string,
	inpWorld InputValueWorld,
) (InputValueWorldObject, func(), error)

ResolveValue resolves the InputWorldObject to a InputValueWorldObject.

note: if object_rev < input.object_rev, returns nil, nil, nil inpWorld and inpPrevValue can be nil may return nil, nil, nil if no value

func (*InputWorldObject) SizeVT

func (m *InputWorldObject) SizeVT() (n int)

func (*InputWorldObject) String

func (x *InputWorldObject) String() string

func (*InputWorldObject) UnmarshalJSON

func (x *InputWorldObject) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the InputWorldObject from JSON.

func (*InputWorldObject) UnmarshalProtoJSON

func (x *InputWorldObject) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the InputWorldObject message from JSON.

func (*InputWorldObject) UnmarshalVT

func (m *InputWorldObject) UnmarshalVT(dAtA []byte) error

func (*InputWorldObject) Validate

func (i *InputWorldObject) Validate() error

Validate validates the input world object.

type Output

type Output struct {

	// Name is the unique name of the output.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// OutputType is the type of output.
	OutputType OutputType `protobuf:"varint,2,opt,name=output_type,json=outputType,proto3" json:"outputType,omitempty"`
	// ExecOutput is the name of the exec output to mount.
	// OutputType_EXEC
	ExecOutput string `protobuf:"bytes,3,opt,name=exec_output,json=execOutput,proto3" json:"execOutput,omitempty"`
	// Value is an in-line output value.
	// OutputType_VALUE
	Value *value.Value `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Output contains configuration of a target task output. This specifies where to get the Output value from.

func NewOutputWithValue

func NewOutputWithValue(name string, val *forge_value.Value) *Output

NewOutputWithValue constructs a new Output with an in-line value.

func (*Output) CloneMessageVT

func (m *Output) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Output) CloneVT

func (m *Output) CloneVT() *Output

func (*Output) EqualMessageVT

func (this *Output) EqualMessageVT(thatMsg any) bool

func (*Output) EqualVT

func (this *Output) EqualVT(that *Output) bool

func (*Output) GetExecOutput

func (x *Output) GetExecOutput() string

func (*Output) GetName

func (x *Output) GetName() string

func (*Output) GetOutputType

func (x *Output) GetOutputType() OutputType

func (*Output) GetValue

func (x *Output) GetValue() *value.Value

func (*Output) IsNil

func (o *Output) IsNil() bool

IsNil checks if the object is nil.

func (*Output) MarshalJSON

func (x *Output) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Output to JSON.

func (*Output) MarshalProtoJSON

func (x *Output) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Output message to JSON.

func (*Output) MarshalProtoText

func (x *Output) MarshalProtoText() string

func (*Output) MarshalToSizedBufferVT

func (m *Output) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Output) MarshalToVT

func (m *Output) MarshalToVT(dAtA []byte) (int, error)

func (*Output) MarshalVT

func (m *Output) MarshalVT() (dAtA []byte, err error)

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) Reset

func (x *Output) Reset()

func (*Output) SizeVT

func (m *Output) SizeVT() (n int)

func (*Output) String

func (x *Output) String() string

func (*Output) UnmarshalJSON

func (x *Output) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Output from JSON.

func (*Output) UnmarshalProtoJSON

func (x *Output) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Output message from JSON.

func (*Output) UnmarshalVT

func (m *Output) UnmarshalVT(dAtA []byte) error

func (*Output) Validate

func (o *Output) Validate() error

Validate validates the Output object.

type OutputType

type OutputType int32

OutputType is the list of possible output types.

const (
	// OutputType_UNKNOWN is the zero output type.
	OutputType_OutputType_UNKNOWN OutputType = 0
	// OutputType_EXEC is an output value mounted from an exec instance.
	OutputType_OutputType_EXEC OutputType = 1
	// OutputType_VALUE is an in-line output value (specified in the target).
	OutputType_OutputType_VALUE OutputType = 2
)

func (OutputType) Enum

func (x OutputType) Enum() *OutputType

func (OutputType) MarshalJSON

func (x OutputType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the OutputType to JSON.

func (OutputType) MarshalProtoJSON

func (x OutputType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the OutputType to JSON.

func (OutputType) MarshalProtoText

func (x OutputType) MarshalProtoText() string

func (OutputType) MarshalText

func (x OutputType) MarshalText() ([]byte, error)

MarshalText marshals the OutputType to text.

func (OutputType) String

func (x OutputType) String() string

func (*OutputType) UnmarshalJSON

func (x *OutputType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the OutputType from JSON.

func (*OutputType) UnmarshalProtoJSON

func (x *OutputType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the OutputType from JSON.

func (*OutputType) UnmarshalText

func (x *OutputType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the OutputType from text.

func (OutputType) Validate

func (t OutputType) Validate(allowUnknown bool) error

Validate validates the output type.

type Target

type Target struct {

	// Inputs is the mapping of inputs.
	// Not necessarily sorted or unique, later values override earlier.
	Inputs []*Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// Outputs is the mapping of outputs.
	// Not necessarily sorted or unique, later values override earlier.
	Outputs []*Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// Exec is the execution pass configuration.
	Exec *Exec `protobuf:"bytes,3,opt,name=exec,proto3" json:"exec,omitempty"`
	// contains filtered or unexported fields
}

Target contains a desired Task target configuration.

func LookupTarget

func LookupTarget(ctx context.Context, ws world.WorldState, objKey string) (*Target, error)

LookupTarget looks up a Target in the world.

func UnmarshalTarget

func UnmarshalTarget(ctx context.Context, bcs *block.Cursor) (*Target, error)

UnmarshalTarget unmarshals an target block from the cursor.

func (*Target) ApplySubBlock

func (t *Target) ApplySubBlock(id uint32, next block.SubBlock) error

ApplySubBlock applies a sub-block change with a field id.

func (*Target) CloneMessageVT

func (m *Target) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Target) CloneVT

func (m *Target) CloneVT() *Target

func (*Target) EqualMessageVT

func (this *Target) EqualMessageVT(thatMsg any) bool

func (*Target) EqualVT

func (this *Target) EqualVT(that *Target) bool

func (*Target) GetExec

func (x *Target) GetExec() *Exec

func (*Target) GetInputs

func (x *Target) GetInputs() []*Input

func (*Target) GetOutputs

func (x *Target) GetOutputs() []*Output

func (*Target) GetSubBlockCtor

func (t *Target) GetSubBlockCtor(id uint32) block.SubBlockCtor

GetSubBlockCtor returns a function which creates or returns the existing sub-block at reference id. Can return nil to indicate invalid reference id.

func (*Target) GetSubBlocks

func (t *Target) GetSubBlocks() map[uint32]block.SubBlock

GetSubBlocks returns all constructed sub-blocks by ID. May return nil, and values may also be nil.

func (*Target) MarshalBlock

func (t *Target) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*Target) MarshalJSON

func (x *Target) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Target to JSON.

func (*Target) MarshalProtoJSON

func (x *Target) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Target message to JSON.

func (*Target) MarshalProtoText

func (x *Target) MarshalProtoText() string

func (*Target) MarshalToSizedBufferVT

func (m *Target) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Target) MarshalToVT

func (m *Target) MarshalToVT(dAtA []byte) (int, error)

func (*Target) MarshalVT

func (m *Target) MarshalVT() (dAtA []byte, err error)

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) Reset

func (x *Target) Reset()

func (*Target) SizeVT

func (m *Target) SizeVT() (n int)

func (*Target) String

func (x *Target) String() string

func (*Target) UnmarshalBlock

func (t *Target) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*Target) UnmarshalJSON

func (x *Target) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Target from JSON.

func (*Target) UnmarshalProtoJSON

func (x *Target) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Target message from JSON.

func (*Target) UnmarshalVT

func (m *Target) UnmarshalVT(dAtA []byte) error

func (*Target) Validate

func (t *Target) Validate() error

Validate performs cursory validation of the target.

type ValueSet

type ValueSet struct {

	// Inputs is the set of inputs.
	// Unique by the "name" field.
	// Sorted by name.
	Inputs []*value.Value `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"`
	// Outputs is the set of outputs.
	// Unique by the "name" field.
	// Sorted by name.
	Outputs []*value.Value `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// contains filtered or unexported fields
}

ValueSet is the set of values satisfying inputs/outputs of a target.

func NewValueSet

func NewValueSet() *ValueSet

NewValueSet constructs a new value set.

func (*ValueSet) ApplySubBlock

func (v *ValueSet) ApplySubBlock(id uint32, next block.SubBlock) error

ApplySubBlock applies a sub-block change with a field id.

func (*ValueSet) Clone

func (v *ValueSet) Clone() *ValueSet

Clone copies the ValueSet.

func (*ValueSet) CloneMessageVT

func (m *ValueSet) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*ValueSet) CloneVT

func (m *ValueSet) CloneVT() *ValueSet

func (*ValueSet) EqualMessageVT

func (this *ValueSet) EqualMessageVT(thatMsg any) bool

func (*ValueSet) EqualVT

func (this *ValueSet) EqualVT(that *ValueSet) bool

func (*ValueSet) GetInputs

func (x *ValueSet) GetInputs() []*value.Value

func (*ValueSet) GetOutputs

func (x *ValueSet) GetOutputs() []*value.Value

func (*ValueSet) GetSubBlockCtor

func (v *ValueSet) GetSubBlockCtor(id uint32) block.SubBlockCtor

GetSubBlockCtor returns a function which creates or returns the existing sub-block at reference id. Can return nil to indicate invalid reference id.

func (*ValueSet) GetSubBlocks

func (v *ValueSet) GetSubBlocks() map[uint32]block.SubBlock

GetSubBlocks returns all constructed sub-blocks by ID. May return nil, and values may also be nil.

func (*ValueSet) IsNil

func (v *ValueSet) IsNil() bool

IsNil checks if the object is nil.

func (*ValueSet) LookupInput

func (v *ValueSet) LookupInput(name string) (*forge_value.Value, int)

LookupInput looks up the input with the given name in the list. returns nil, -1 if not found.

func (*ValueSet) LookupOutput

func (v *ValueSet) LookupOutput(name string) (*forge_value.Value, int)

LookupOutput looks up the output with the given name in the list. returns nil, -1 if not found.

func (*ValueSet) MarshalBlock

func (v *ValueSet) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*ValueSet) MarshalJSON

func (x *ValueSet) MarshalJSON() ([]byte, error)

MarshalJSON marshals the ValueSet to JSON.

func (*ValueSet) MarshalProtoJSON

func (x *ValueSet) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ValueSet message to JSON.

func (*ValueSet) MarshalProtoText

func (x *ValueSet) MarshalProtoText() string

func (*ValueSet) MarshalToSizedBufferVT

func (m *ValueSet) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*ValueSet) MarshalToVT

func (m *ValueSet) MarshalToVT(dAtA []byte) (int, error)

func (*ValueSet) MarshalVT

func (m *ValueSet) MarshalVT() (dAtA []byte, err error)

func (*ValueSet) ProtoMessage

func (*ValueSet) ProtoMessage()

func (*ValueSet) Reset

func (x *ValueSet) Reset()

func (*ValueSet) SizeVT

func (m *ValueSet) SizeVT() (n int)

func (*ValueSet) SortValues

func (v *ValueSet) SortValues()

SortValues sorts the inputs and outputs fields.

func (*ValueSet) String

func (x *ValueSet) String() string

func (*ValueSet) UnmarshalBlock

func (v *ValueSet) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*ValueSet) UnmarshalJSON

func (x *ValueSet) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the ValueSet from JSON.

func (*ValueSet) UnmarshalProtoJSON

func (x *ValueSet) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the ValueSet message from JSON.

func (*ValueSet) UnmarshalVT

func (m *ValueSet) UnmarshalVT(dAtA []byte) error

func (*ValueSet) Validate

func (v *ValueSet) Validate() error

Validate performs cursory checks of the ValueSet.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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