adapter

package
v3.4.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPeerDescriptor

func NewPeerDescriptor(typedDescriptor *PeerDescriptor) *KVDescriptor

Types

type PeerDescriptor

type PeerDescriptor struct {
	Name                 string
	KeySelector          KeySelector
	ValueTypeName        string
	KeyLabel             func(key string) string
	ValueComparator      func(key string, oldValue, newValue *vpp_wg.Peer) bool
	NBKeyPrefix          string
	WithMetadata         bool
	MetadataMapFactory   MetadataMapFactory
	Validate             func(key string, value *vpp_wg.Peer) error
	Create               func(key string, value *vpp_wg.Peer) (metadata *wgidx.WgMetadata, err error)
	Delete               func(key string, value *vpp_wg.Peer, metadata *wgidx.WgMetadata) error
	Update               func(key string, oldValue, newValue *vpp_wg.Peer, oldMetadata *wgidx.WgMetadata) (newMetadata *wgidx.WgMetadata, err error)
	UpdateWithRecreate   func(key string, oldValue, newValue *vpp_wg.Peer, metadata *wgidx.WgMetadata) bool
	Retrieve             func(correlate []PeerKVWithMetadata) ([]PeerKVWithMetadata, error)
	IsRetriableFailure   func(err error) bool
	DerivedValues        func(key string, value *vpp_wg.Peer) []KeyValuePair
	Dependencies         func(key string, value *vpp_wg.Peer) []Dependency
	RetrieveDependencies []string /* descriptor name */
}

type PeerDescriptorAdapter

type PeerDescriptorAdapter struct {
	// contains filtered or unexported fields
}

func (*PeerDescriptorAdapter) Create

func (da *PeerDescriptorAdapter) Create(key string, value proto.Message) (metadata Metadata, err error)

func (*PeerDescriptorAdapter) Delete

func (da *PeerDescriptorAdapter) Delete(key string, value proto.Message, metadata Metadata) error

func (*PeerDescriptorAdapter) Dependencies

func (da *PeerDescriptorAdapter) Dependencies(key string, value proto.Message) []Dependency

func (*PeerDescriptorAdapter) DerivedValues

func (da *PeerDescriptorAdapter) DerivedValues(key string, value proto.Message) []KeyValuePair

func (*PeerDescriptorAdapter) Retrieve

func (da *PeerDescriptorAdapter) Retrieve(correlate []KVWithMetadata) ([]KVWithMetadata, error)

func (*PeerDescriptorAdapter) Update

func (da *PeerDescriptorAdapter) Update(key string, oldValue, newValue proto.Message, oldMetadata Metadata) (newMetadata Metadata, err error)

func (*PeerDescriptorAdapter) UpdateWithRecreate

func (da *PeerDescriptorAdapter) UpdateWithRecreate(key string, oldValue, newValue proto.Message, metadata Metadata) bool

func (*PeerDescriptorAdapter) Validate

func (da *PeerDescriptorAdapter) Validate(key string, value proto.Message) (err error)

func (*PeerDescriptorAdapter) ValueComparator

func (da *PeerDescriptorAdapter) ValueComparator(key string, oldValue, newValue proto.Message) bool

type PeerKVWithMetadata

type PeerKVWithMetadata struct {
	Key      string
	Value    *vpp_wg.Peer
	Metadata *wgidx.WgMetadata
	Origin   ValueOrigin
}

Jump to

Keyboard shortcuts

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