controller_exec

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ControllerStatus_name = map[int32]string{
		0: "ControllerStatus_UNKNOWN",
		1: "ControllerStatus_CONFIGURING",
		2: "ControllerStatus_RUNNING",
		3: "ControllerStatus_ERROR",
	}
	ControllerStatus_value = map[string]int32{
		"ControllerStatus_UNKNOWN":     0,
		"ControllerStatus_CONFIGURING": 1,
		"ControllerStatus_RUNNING":     2,
		"ControllerStatus_ERROR":       3,
	}
)

Enum value maps for ControllerStatus.

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrAllControllersFailed = errors.New("all controller configurations failed")

ErrAllControllersFailed is returned if all controller configs failed to run.

View Source
var File_github_com_aperturerobotics_controllerbus_controller_exec_exec_proto protoreflect.FileDescriptor

Functions

func ExecuteController

func ExecuteController(
	ctx context.Context,
	cbus bus.Bus,
	conf config.Config,
	cb func(ControllerStatus),
) error

ExecuteController executes a controller and calls the callback with state.

Note: any ERROR state will return immediately after calling cb(). Some terminal error states may exit without calling cb().

Types

type ControllerStatus

type ControllerStatus int32

ControllerStatus holds basic status for a controller.

const (
	// ControllerStatus_UNKNOWN is unrecognized.
	ControllerStatus_ControllerStatus_UNKNOWN ControllerStatus = 0
	// ControllerStatus_CONFIGURING indicates the controller is configuring.
	ControllerStatus_ControllerStatus_CONFIGURING ControllerStatus = 1
	// ControllerStatus_RUNNING indicates the controller is running.
	ControllerStatus_ControllerStatus_RUNNING ControllerStatus = 2
	// ControllerStatus_ERROR indicates the controller is terminated with an error.
	ControllerStatus_ControllerStatus_ERROR ControllerStatus = 3
)

func (ControllerStatus) Descriptor added in v0.10.1

func (ControllerStatus) Enum added in v0.10.1

func (ControllerStatus) EnumDescriptor deprecated

func (ControllerStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use ControllerStatus.Descriptor instead.

func (ControllerStatus) Number added in v0.10.1

func (ControllerStatus) String

func (x ControllerStatus) String() string

func (ControllerStatus) Type added in v0.10.1

type ExecControllerRequest

type ExecControllerRequest struct {

	// ConfigSet is the controller config set to execute.
	ConfigSet *proto.ConfigSet `protobuf:"bytes,1,opt,name=config_set,json=configSet,proto3" json:"config_set,omitempty"`
	// ConfigSetYaml is optionally the YAML form of config_set to parse.
	// Merged with config_set.
	ConfigSetYaml string `protobuf:"bytes,2,opt,name=config_set_yaml,json=configSetYaml,proto3" json:"config_set_yaml,omitempty"`
	// ConfigSetYamlOverwrite sets if the yaml portion overwrites the proto portion.
	ConfigSetYamlOverwrite bool `` /* 132-byte string literal not displayed */
	// contains filtered or unexported fields
}

ExecControllerRequest is a protobuf request to execute a controller.

func ExecControllerProtoFromConfigSet added in v0.8.7

func ExecControllerProtoFromConfigSet(cs configset.ConfigSet) (*ExecControllerRequest, error)

ExecControllerProtoFromConfigSet converts a config set to a ExecControllerRequest w/ proto.

func ExecControllerYAMLFromConfigSet added in v0.8.7

func ExecControllerYAMLFromConfigSet(cs configset.ConfigSet) (*ExecControllerRequest, error)

ExecControllerYAMLFromConfigSet converts a config set to a ExecControllerRequest w/ YAML.

func (*ExecControllerRequest) CloneGenericVT added in v0.12.3

func (m *ExecControllerRequest) CloneGenericVT() proto1.Message

func (*ExecControllerRequest) CloneVT added in v0.12.3

func (*ExecControllerRequest) Descriptor deprecated

func (*ExecControllerRequest) Descriptor() ([]byte, []int)

Deprecated: Use ExecControllerRequest.ProtoReflect.Descriptor instead.

func (*ExecControllerRequest) EqualVT added in v0.10.0

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

func (*ExecControllerRequest) Execute

func (r *ExecControllerRequest) Execute(
	ctx context.Context,
	cbus bus.Bus,
	allowPartialSuccess bool,
	cb func(*ExecControllerResponse) error,
) error

Execute executes the request to apply a config set. Cb should not hold ExecControllerResponse after returning.

func (*ExecControllerRequest) GetConfigSet

func (x *ExecControllerRequest) GetConfigSet() *proto.ConfigSet

func (*ExecControllerRequest) GetConfigSetYaml

func (x *ExecControllerRequest) GetConfigSetYaml() string

func (*ExecControllerRequest) GetConfigSetYamlOverwrite

func (x *ExecControllerRequest) GetConfigSetYamlOverwrite() bool

func (*ExecControllerRequest) MarshalToSizedBufferVT added in v0.10.0

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

func (*ExecControllerRequest) MarshalToVT added in v0.10.0

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

func (*ExecControllerRequest) MarshalVT added in v0.10.0

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

func (*ExecControllerRequest) ProtoMessage

func (*ExecControllerRequest) ProtoMessage()

func (*ExecControllerRequest) ProtoReflect added in v0.10.1

func (x *ExecControllerRequest) ProtoReflect() protoreflect.Message

func (*ExecControllerRequest) Reset

func (x *ExecControllerRequest) Reset()

func (*ExecControllerRequest) SizeVT added in v0.10.0

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

func (*ExecControllerRequest) String

func (x *ExecControllerRequest) String() string

func (*ExecControllerRequest) UnmarshalVT added in v0.10.0

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

type ExecControllerResponse

type ExecControllerResponse struct {

	// Id is the configset identifier for this status report.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Status is the controller execution status.
	Status ControllerStatus `protobuf:"varint,2,opt,name=status,proto3,enum=controller.exec.ControllerStatus" json:"status,omitempty"`
	// ControllerInfo may contain the running controller info.
	ControllerInfo *controller.Info `protobuf:"bytes,3,opt,name=controller_info,json=controllerInfo,proto3" json:"controller_info,omitempty"`
	// ErrorInfo may contain the error information.
	ErrorInfo string `protobuf:"bytes,4,opt,name=error_info,json=errorInfo,proto3" json:"error_info,omitempty"`
	// contains filtered or unexported fields
}

ExecControllerResponse is a protobuf response stream.

func (*ExecControllerResponse) CloneGenericVT added in v0.12.3

func (m *ExecControllerResponse) CloneGenericVT() proto1.Message

func (*ExecControllerResponse) CloneVT added in v0.12.3

func (*ExecControllerResponse) Descriptor deprecated

func (*ExecControllerResponse) Descriptor() ([]byte, []int)

Deprecated: Use ExecControllerResponse.ProtoReflect.Descriptor instead.

func (*ExecControllerResponse) EqualVT added in v0.10.0

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

func (*ExecControllerResponse) GetControllerInfo

func (x *ExecControllerResponse) GetControllerInfo() *controller.Info

func (*ExecControllerResponse) GetError added in v0.8.7

func (e *ExecControllerResponse) GetError() error

GetError returns an error if the response indicated one, or nil for success.

If no error info was provided, assumes ErrAllControllersFailed

func (*ExecControllerResponse) GetErrorInfo

func (x *ExecControllerResponse) GetErrorInfo() string

func (*ExecControllerResponse) GetId

func (x *ExecControllerResponse) GetId() string

func (*ExecControllerResponse) GetStatus

func (*ExecControllerResponse) MarshalToSizedBufferVT added in v0.10.0

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

func (*ExecControllerResponse) MarshalToVT added in v0.10.0

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

func (*ExecControllerResponse) MarshalVT added in v0.10.0

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

func (*ExecControllerResponse) ProtoMessage

func (*ExecControllerResponse) ProtoMessage()

func (*ExecControllerResponse) ProtoReflect added in v0.10.1

func (x *ExecControllerResponse) ProtoReflect() protoreflect.Message

func (*ExecControllerResponse) Reset

func (x *ExecControllerResponse) Reset()

func (*ExecControllerResponse) SizeVT added in v0.10.0

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

func (*ExecControllerResponse) String

func (x *ExecControllerResponse) String() string

func (*ExecControllerResponse) UnmarshalVT added in v0.10.0

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

Jump to

Keyboard shortcuts

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