configset_proto

package
v0.44.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 15 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.

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 {

	// Configs contains the controller configurations.
	Configs map[string]*ControllerConfig `` /* 155-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() protobuf_go_lite.CloneMessage

func (*ConfigSet) CloneVT added in v0.12.3

func (m *ConfigSet) CloneVT() *ConfigSet

func (*ConfigSet) EqualMessageVT added in v0.23.6

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

func (*ConfigSet) EqualVT added in v0.10.0

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

func (*ConfigSet) GetConfigs added in v0.41.0

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

func (*ConfigSet) MarshalJSON added in v0.41.0

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

MarshalJSON marshals the ConfigSet to JSON.

func (*ConfigSet) MarshalProtoJSON added in v0.41.0

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

MarshalProtoJSON marshals the ConfigSet message to JSON.

func (*ConfigSet) MarshalProtoText added in v0.42.0

func (x *ConfigSet) MarshalProtoText() string

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) 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) UnmarshalJSON added in v0.41.0

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

UnmarshalJSON unmarshals the ConfigSet from JSON.

func (*ConfigSet) UnmarshalProtoJSON added in v0.41.0

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

UnmarshalProtoJSON unmarshals the ConfigSet message from JSON.

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 ConfigSet_ConfigsEntry added in v0.41.0

type ConfigSet_ConfigsEntry struct {
	Key   string            `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value *ControllerConfig `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigSet_ConfigsEntry) GetKey added in v0.41.0

func (x *ConfigSet_ConfigsEntry) GetKey() string

func (*ConfigSet_ConfigsEntry) GetValue added in v0.41.0

func (*ConfigSet_ConfigsEntry) MarshalJSON added in v0.41.0

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

MarshalJSON marshals the ConfigSet_ConfigsEntry to JSON.

func (*ConfigSet_ConfigsEntry) MarshalProtoJSON added in v0.41.0

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

MarshalProtoJSON marshals the ConfigSet_ConfigsEntry message to JSON.

func (*ConfigSet_ConfigsEntry) MarshalProtoText added in v0.42.0

func (x *ConfigSet_ConfigsEntry) MarshalProtoText() string

func (*ConfigSet_ConfigsEntry) ProtoMessage added in v0.41.0

func (*ConfigSet_ConfigsEntry) ProtoMessage()

func (*ConfigSet_ConfigsEntry) Reset added in v0.41.0

func (x *ConfigSet_ConfigsEntry) Reset()

func (*ConfigSet_ConfigsEntry) String added in v0.42.0

func (x *ConfigSet_ConfigsEntry) String() string

func (*ConfigSet_ConfigsEntry) UnmarshalJSON added in v0.41.0

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

UnmarshalJSON unmarshals the ConfigSet_ConfigsEntry from JSON.

func (*ConfigSet_ConfigsEntry) UnmarshalProtoJSON added in v0.41.0

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

UnmarshalProtoJSON unmarshals the ConfigSet_ConfigsEntry message from JSON.

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.
	// Proto supports: protobuf (binary) and json (starting with {).
	// Json supports: protobuf (base64) and json (inline object).
	Config []byte `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

ControllerConfig contains a controller configuration.

protobuf-go-lite:disable-json

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() protobuf_go_lite.CloneMessage

func (*ControllerConfig) CloneVT added in v0.12.3

func (m *ControllerConfig) CloneVT() *ControllerConfig

func (*ControllerConfig) EqualMessageVT added in v0.23.6

func (this *ControllerConfig) EqualMessageVT(thatMsg any) 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 the ControllerConfig to JSON.

func (*ControllerConfig) MarshalProtoJSON added in v0.41.0

func (c *ControllerConfig) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the ControllerConfig message to JSON.

func (*ControllerConfig) MarshalProtoText added in v0.42.0

func (x *ControllerConfig) MarshalProtoText() string

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) 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(b []byte) error

UnmarshalJSON unmarshals the ControllerConfig from JSON.

func (*ControllerConfig) UnmarshalProtoJSON added in v0.41.0

func (c *ControllerConfig) UnmarshalProtoJSON(s *json.UnmarshalState)

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