configset_proto

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrControllerConfigIdEmpty = errors.New("controller config id empty")

ErrControllerConfigIdEmpty is returned if the controller config id was empty.

View Source
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

func MergeConfigSets(sets ...*ConfigSet) *ConfigSet

MergeConfigSets merges multiple config sets maps to one ConfigSet.

func NewConfigSet

func NewConfigSet(c configset.ConfigSet, useJson bool) (*ConfigSet, error)

NewConfigSet constructs a configset from a configset.ConfigSet.

func (*ConfigSet) CloneMessageVT added in v0.23.6

func (m *ConfigSet) CloneMessageVT() proto.Message

func (*ConfigSet) CloneVT added in v0.12.3

func (m *ConfigSet) CloneVT() *ConfigSet

func (*ConfigSet) Descriptor deprecated

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

Deprecated: Use ConfigSet.ProtoReflect.Descriptor instead.

func (*ConfigSet) EqualMessageVT added in v0.23.6

func (this *ConfigSet) EqualMessageVT(thatMsg proto.Message) bool

func (*ConfigSet) EqualVT added in v0.10.0

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

func (*ConfigSet) GetConfigurations

func (x *ConfigSet) GetConfigurations() map[string]*ControllerConfig

func (*ConfigSet) MarshalToSizedBufferVT added in v0.10.0

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

func (*ConfigSet) MarshalToVT added in v0.10.0

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

func (*ConfigSet) MarshalVT added in v0.10.0

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

func (*ConfigSet) ProtoMessage

func (*ConfigSet) ProtoMessage()

func (*ConfigSet) ProtoReflect added in v0.10.1

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

func (*ConfigSet) Reset

func (x *ConfigSet) Reset()

func (*ConfigSet) Resolve

func (c *ConfigSet) Resolve(ctx context.Context, b bus.Bus) (configset.ConfigSet, error)

Resolve resolves the configset into a configset.ConfigSet

func (*ConfigSet) SizeVT added in v0.10.0

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

func (*ConfigSet) String

func (x *ConfigSet) String() string

func (*ConfigSet) UnmarshalVT added in v0.10.0

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

func (*ConfigSet) Validate added in v0.15.1

func (c *ConfigSet) Validate() error

Validate validates the ConfigSet.

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) Resolve

func (c ConfigSetMap) Resolve(ctx context.Context, b bus.Bus) (configset.ConfigSet, error)

Resolve resolves the configset into a configset.ConfigSet

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

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.

Jump to

Keyboard shortcuts

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