adapter

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0 Imports: 3 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterfaceDescriptor

func NewInterfaceDescriptor(typedDescriptor *InterfaceDescriptor) *KVDescriptor

func NewRouteDescriptor

func NewRouteDescriptor(typedDescriptor *RouteDescriptor) *KVDescriptor

Types

type InterfaceDescriptor

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

type InterfaceDescriptorAdapter

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

func (*InterfaceDescriptorAdapter) Create

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

func (*InterfaceDescriptorAdapter) Delete

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

func (*InterfaceDescriptorAdapter) Dependencies

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

func (*InterfaceDescriptorAdapter) DerivedValues

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

func (*InterfaceDescriptorAdapter) Retrieve

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

func (*InterfaceDescriptorAdapter) Update

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

func (*InterfaceDescriptorAdapter) UpdateWithRecreate

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

func (*InterfaceDescriptorAdapter) Validate

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

func (*InterfaceDescriptorAdapter) ValueComparator

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

type InterfaceKVWithMetadata

type InterfaceKVWithMetadata struct {
	Key      string
	Value    *model.Interface
	Metadata interface{}
	Origin   ValueOrigin
}

type RouteDescriptor

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

type RouteDescriptorAdapter

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

func (*RouteDescriptorAdapter) Create

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

func (*RouteDescriptorAdapter) Delete

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

func (*RouteDescriptorAdapter) Dependencies

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

func (*RouteDescriptorAdapter) DerivedValues

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

func (*RouteDescriptorAdapter) Retrieve

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

func (*RouteDescriptorAdapter) Update

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

func (*RouteDescriptorAdapter) UpdateWithRecreate

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

func (*RouteDescriptorAdapter) Validate

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

func (*RouteDescriptorAdapter) ValueComparator

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

type RouteKVWithMetadata

type RouteKVWithMetadata struct {
	Key      string
	Value    *model.Route
	Metadata interface{}
	Origin   ValueOrigin
}

Jump to

Keyboard shortcuts

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