Documentation ¶
Index ¶
- Variables
- func MergeConfigSetMaps(out ConfigSetMap, sets ...ConfigSetMap)
- type ConfigSet
- func (m *ConfigSet) CloneMessageVT() proto.Message
- func (m *ConfigSet) CloneVT() *ConfigSet
- func (*ConfigSet) Descriptor() ([]byte, []int)deprecated
- func (this *ConfigSet) EqualMessageVT(thatMsg proto.Message) bool
- func (this *ConfigSet) EqualVT(that *ConfigSet) bool
- func (x *ConfigSet) GetConfigurations() map[string]*ControllerConfig
- func (m *ConfigSet) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ConfigSet) MarshalToVT(dAtA []byte) (int, error)
- func (m *ConfigSet) MarshalVT() (dAtA []byte, err error)
- func (*ConfigSet) ProtoMessage()
- func (x *ConfigSet) ProtoReflect() protoreflect.Message
- func (x *ConfigSet) Reset()
- func (c *ConfigSet) Resolve(ctx context.Context, b bus.Bus) (configset.ConfigSet, error)
- func (m *ConfigSet) SizeVT() (n int)
- func (x *ConfigSet) String() string
- func (m *ConfigSet) UnmarshalVT(dAtA []byte) error
- func (c *ConfigSet) Validate() error
- type ConfigSetMap
- type ControllerConfig
- func (m *ControllerConfig) CloneMessageVT() proto.Message
- func (m *ControllerConfig) CloneVT() *ControllerConfig
- func (*ControllerConfig) Descriptor() ([]byte, []int)deprecated
- func (this *ControllerConfig) EqualMessageVT(thatMsg proto.Message) bool
- func (this *ControllerConfig) EqualVT(that *ControllerConfig) bool
- func (x *ControllerConfig) GetConfig() []byte
- func (x *ControllerConfig) GetId() string
- func (x *ControllerConfig) GetRev() uint64
- func (c *ControllerConfig) MarshalJSON() ([]byte, error)
- func (m *ControllerConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *ControllerConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *ControllerConfig) MarshalVT() (dAtA []byte, err error)
- func (*ControllerConfig) ProtoMessage()
- func (x *ControllerConfig) ProtoReflect() protoreflect.Message
- func (x *ControllerConfig) Reset()
- func (c *ControllerConfig) Resolve(ctx context.Context, b bus.Bus) (configset.ControllerConfig, error)
- func (m *ControllerConfig) SizeVT() (n int)
- func (x *ControllerConfig) String() string
- func (c *ControllerConfig) UnmarshalJSON(data []byte) error
- func (m *ControllerConfig) UnmarshalVT(dAtA []byte) error
- func (c *ControllerConfig) Validate() error
Constants ¶
This section is empty.
Variables ¶
var ErrControllerConfigIdEmpty = errors.New("controller config id empty")
ErrControllerConfigIdEmpty is returned if the controller config id was empty.
var File_github_com_aperturerobotics_controllerbus_controller_configset_proto_configset_proto protoreflect.FileDescriptor
Functions ¶
func MergeConfigSetMaps ¶ added in v0.15.5
func MergeConfigSetMaps(out ConfigSetMap, sets ...ConfigSetMap)
MergeConfigSetMaps merges multiple config set maps to one ConfigSetMap.
Types ¶
type ConfigSet ¶
type ConfigSet struct { // Configurations contains the controller configurations. Configurations map[string]*ControllerConfig `` /* 169-byte string literal not displayed */ // contains filtered or unexported fields }
ConfigSet contains a configuration set.
func MergeConfigSets ¶ added in v0.15.5
MergeConfigSets merges multiple config sets maps to one ConfigSet.
func NewConfigSet ¶
NewConfigSet constructs a configset from a configset.ConfigSet.
func (*ConfigSet) CloneMessageVT ¶ added in v0.23.6
func (*ConfigSet) Descriptor
deprecated
func (*ConfigSet) EqualMessageVT ¶ added in v0.23.6
func (*ConfigSet) GetConfigurations ¶
func (x *ConfigSet) GetConfigurations() map[string]*ControllerConfig
func (*ConfigSet) MarshalToSizedBufferVT ¶ added in v0.10.0
func (*ConfigSet) MarshalToVT ¶ added in v0.10.0
func (*ConfigSet) ProtoMessage ¶
func (*ConfigSet) ProtoMessage()
func (*ConfigSet) ProtoReflect ¶ added in v0.10.1
func (x *ConfigSet) ProtoReflect() protoreflect.Message
func (*ConfigSet) UnmarshalVT ¶ added in v0.10.0
type ConfigSetMap ¶
type ConfigSetMap map[string]*ControllerConfig
ConfigSetMap implements the controllerbus.ConfigSet as protobuf. Cast the proto type to this type.
func NewConfigSetMap ¶
func NewConfigSetMap(c configset.ConfigSet, useJson bool) (ConfigSetMap, error)
NewConfigSetMap packs a configset to a proto object.
func (ConfigSetMap) ApplyConfig ¶ added in v0.31.1
func (c ConfigSetMap) ApplyConfig(id string, conf config.Config, rev uint64, useJson bool) (*ControllerConfig, error)
ApplyConfig applies a config to the ConfigSetMap.
func (ConfigSetMap) Validate ¶ added in v0.15.1
func (c ConfigSetMap) Validate() error
Validate validates the ConfigSetMap.
type ControllerConfig ¶
type ControllerConfig struct { // Id is the config ID. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Rev is the revision number of the configuration. Rev uint64 `protobuf:"varint,2,opt,name=rev,proto3" json:"rev,omitempty"` // Config is the configuration object. // Supports: protobuf and json (must start with {). Config []byte `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` // contains filtered or unexported fields }
ControllerConfig contains a controller configuration.
func NewControllerConfig ¶
func NewControllerConfig(c configset.ControllerConfig, useJson bool) (*ControllerConfig, error)
NewControllerConfig constructs a new controller config.
func (*ControllerConfig) CloneMessageVT ¶ added in v0.23.6
func (m *ControllerConfig) CloneMessageVT() proto.Message
func (*ControllerConfig) CloneVT ¶ added in v0.12.3
func (m *ControllerConfig) CloneVT() *ControllerConfig
func (*ControllerConfig) Descriptor
deprecated
func (*ControllerConfig) Descriptor() ([]byte, []int)
Deprecated: Use ControllerConfig.ProtoReflect.Descriptor instead.
func (*ControllerConfig) EqualMessageVT ¶ added in v0.23.6
func (this *ControllerConfig) EqualMessageVT(thatMsg proto.Message) bool
func (*ControllerConfig) EqualVT ¶ added in v0.10.0
func (this *ControllerConfig) EqualVT(that *ControllerConfig) bool
func (*ControllerConfig) GetConfig ¶
func (x *ControllerConfig) GetConfig() []byte
func (*ControllerConfig) GetId ¶
func (x *ControllerConfig) GetId() string
func (*ControllerConfig) GetRev ¶ added in v0.26.0
func (x *ControllerConfig) GetRev() uint64
func (*ControllerConfig) MarshalJSON ¶ added in v0.24.0
func (c *ControllerConfig) MarshalJSON() ([]byte, error)
MarshalJSON marshals json from the controller config. For the config field: supports JSON, YAML, or a string containing either.
func (*ControllerConfig) MarshalToSizedBufferVT ¶ added in v0.10.0
func (m *ControllerConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*ControllerConfig) MarshalToVT ¶ added in v0.10.0
func (m *ControllerConfig) MarshalToVT(dAtA []byte) (int, error)
func (*ControllerConfig) MarshalVT ¶ added in v0.10.0
func (m *ControllerConfig) MarshalVT() (dAtA []byte, err error)
func (*ControllerConfig) ProtoMessage ¶
func (*ControllerConfig) ProtoMessage()
func (*ControllerConfig) ProtoReflect ¶ added in v0.10.1
func (x *ControllerConfig) ProtoReflect() protoreflect.Message
func (*ControllerConfig) Reset ¶
func (x *ControllerConfig) Reset()
func (*ControllerConfig) Resolve ¶
func (c *ControllerConfig) Resolve(ctx context.Context, b bus.Bus) (configset.ControllerConfig, error)
Resolve resolves the config into a configset.ControllerConfig
func (*ControllerConfig) SizeVT ¶ added in v0.10.0
func (m *ControllerConfig) SizeVT() (n int)
func (*ControllerConfig) String ¶
func (x *ControllerConfig) String() string
func (*ControllerConfig) UnmarshalJSON ¶ added in v0.15.1
func (c *ControllerConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals json to the controller config. For the config field: supports JSON, YAML, or a string containing either.
func (*ControllerConfig) UnmarshalVT ¶ added in v0.10.0
func (m *ControllerConfig) UnmarshalVT(dAtA []byte) error
func (*ControllerConfig) Validate ¶
func (c *ControllerConfig) Validate() error
Validate performs cursory validation of the controller config.