configapi

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MPL-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SelectorsHelperCache

func SelectorsHelperCache(s *Selectors)

func SelectorsHelperCacheValue

func SelectorsHelperCacheValue(s *Selectors) string

Types

type AcquireConfigurationFailRes

type AcquireConfigurationFailRes struct {
	Code     string   `cbor:"code,"`
	Message  string   `cbor:"msg,"`
	InfoList []string `cbor:"info_list,"`
}

type AcquireConfigurationReq

type AcquireConfigurationReq struct {
	Requested         []RequestedConfigurationKey `cbor:"req,"`
	Selectors         Selectors                   `cbor:"selectors,"`
	OptionalSelectors Selectors                   `cbor:"opt_selectors,"`
}

type AcquireConfigurationRes

type AcquireConfigurationRes struct {
	Requested []Configuration `cbor:"req,"`
}

type Configuration

type Configuration struct {
	// Group is a set of configurations
	Group string `cbor:"group,"`
	// Key is the name of the configuration
	Key string `cbor:"key,"`
	// Version represents the unique configuration history
	Version string `cbor:"version,"`

	// Value is the complete data of the configuration
	Value []byte `cbor:"value,"`
	// Signature represents the data integrity of the configuration
	Signature string `cbor:"sign,"`
	// Selector represents the part where the configuration will be used
	Selectors Selectors `cbor:"selectors,"`
	// OptionalSelectors is used for optional selectors matching
	OptionalSelectors Selectors `cbor:"opt_selectors,"`
	// Timestamp is the unix timestamp in second of the effective time(create/update) of this configuration
	Timestamp int64 `cbor:"timestamp,"`
}

func (*Configuration) GenerateSignature added in v0.10.10

func (c *Configuration) GenerateSignature() string

func (*Configuration) ValidateSignature added in v0.10.10

func (c *Configuration) ValidateSignature() bool

type DataPump

type DataPump interface {
	Startup() error
	Stop() error
	EventChannel() <-chan Event
	TriggerDumpToChannel() <-chan Event
}

type DataWriter added in v0.10.10

type DataWriter interface {
	Startup() error
	Stop() error
	SaveConfiguration(cfg Configuration) error
	DeleteConfiguration(group, key, sel, optSel string) (bool, error)
}

type Event

type Event struct {
	Configuration *Configuration

	Created  bool
	Modified bool
	Deleted  bool
}

type GetConfigurationRes

type GetConfigurationRes struct {
	Code          string        `cbor:"code,"`
	Message       string        `cbor:"msg,"`
	Configuration Configuration `cbor:"cfg"`
}

type PublishReq

type PublishReq struct {
	Configuration     RawConfiguration `cbor:"cfg,"`
	Selectors         Selectors        `cbor:"selectors,"`
	OptionalSelectors Selectors        `cbor:"opt_selectors,"`
	Operator          string           `cbor:"operator,"`
	Description       string           `cbor:"description"`
}

type PublishRes

type PublishRes struct {
	Success bool   `cbor:"success,"`
	Code    string `cbor:"code,"`
	Message string `cbor:"message,"`
}

type RawConfiguration

type RawConfiguration struct {
	Group   string `cbor:"group,"`
	Key     string `cbor:"key,"`
	Version string `cbor:"version,"`
	Value   []byte `cbor:"value,"`
}

type RequestedConfigurationKey

type RequestedConfigurationKey struct {
	Group   string `cbor:"group,"`
	Key     string `cbor:"key,"`
	Version string `cbor:"version,"`
}

type Selectors

type Selectors struct {
	Data map[string]string `cbor:"data,"`
	// contains filtered or unexported fields
}

func (*Selectors) Fill added in v0.10.12

func (s *Selectors) Fill(str string) error

type VersionComparator added in v0.10.0

type VersionComparator interface {
	HasUpdate(requestVersion, dataVersion string) bool
}

Jump to

Keyboard shortcuts

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