Documentation ¶
Index ¶
- Variables
- type ConstructOpts
- type Controller
- type Factory
- type FactoryResolver
- type FactoryWithContext
- type Info
- func (i *Info) Clone() *Info
- func (m *Info) CloneMessageVT() proto.Message
- func (m *Info) CloneVT() *Info
- func (*Info) Descriptor() ([]byte, []int)deprecated
- func (this *Info) EqualMessageVT(thatMsg proto.Message) bool
- func (this *Info) EqualVT(that *Info) bool
- func (x *Info) GetDescription() string
- func (x *Info) GetId() string
- func (x *Info) GetVersion() string
- func (m *Info) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Info) MarshalToVT(dAtA []byte) (int, error)
- func (m *Info) MarshalVT() (dAtA []byte, err error)
- func (*Info) ProtoMessage()
- func (x *Info) ProtoReflect() protoreflect.Message
- func (x *Info) Reset()
- func (m *Info) SizeVT() (n int)
- func (x *Info) String() string
- func (m *Info) UnmarshalVT(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
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 File_github_com_aperturerobotics_controllerbus_controller_controller_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ConstructOpts ¶
ConstructOpts contains optional parameters when constructing a controller.
func (*ConstructOpts) GetLogger ¶
func (c *ConstructOpts) GetLogger() *logrus.Entry
GetLogger returns the specified logger or a default one if nil.
type Controller ¶
type Controller interface { // Handler handles directives. directive.Handler // GetControllerInfo returns information about the controller. GetControllerInfo() *Info // Execute executes the controller goroutine. // Returning nil ends execution. // Returning an error triggers a retry with backoff. Execute(ctx context.Context) error // Close releases any resources used by the controller. // Error indicates any issue encountered releasing. Close() error }
Controller tracks a particular process.
type Factory ¶
type Factory interface { // GetConfigID returns the unique config ID for the controller. GetConfigID() string // ConstructConfig constructs an instance of the controller configuration. ConstructConfig() config.Config // Construct constructs the associated controller given configuration. Construct(config.Config, ConstructOpts) (Controller, error) // GetVersion returns the version of this controller. GetVersion() semver.Version }
Factory represents an available controller implementation. The factory can construct instances of the controller given configuration.
type FactoryResolver ¶
type FactoryResolver interface { // GetResolverID returns the resolver identifier. // Ex: static, go-plugin GetResolverID() string // GetResolverVersion returns the resolver version. GetResolverVersion() semver.Version // GetConfigCtorByID returns a config constructor by ID. // If none found, return nil, nil GetConfigCtorByID(ctx context.Context, id string) (config.Constructor, error) // GetFactoryMatchingConfig returns the factory that matches the config. // If no factory is found, return nil. // If an unexpected error occurs, return it. GetFactoryMatchingConfig(ctx context.Context, conf config.Config) (Factory, error) }
FactoryResolver looks up factories that match configurations.
type FactoryWithContext ¶
type FactoryWithContext interface { Factory // GetFactoryContext returns a context that is canceled if the factory is unloaded. GetFactoryContext() context.Context }
FactoryWithContext is a factory with a cancelation context.
type Info ¶
type Info struct { // Id contains the identifier of the controller. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Version contains the version string for the controller. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Description contains a descriptive string about the controller. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
Info contains information about a controller.
func (*Info) CloneMessageVT ¶ added in v0.23.6
func (*Info) Descriptor
deprecated
func (*Info) EqualMessageVT ¶ added in v0.23.6
func (*Info) GetDescription ¶
func (*Info) GetVersion ¶
func (*Info) MarshalToSizedBufferVT ¶ added in v0.10.0
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶ added in v0.10.1
func (x *Info) ProtoReflect() protoreflect.Message
func (*Info) UnmarshalVT ¶ added in v0.10.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.