adapter

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSkeletonDescriptor

func NewSkeletonDescriptor(typedDescriptor *SkeletonDescriptor) *KVDescriptor

Types

type SkeletonDescriptor

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

type SkeletonDescriptorAdapter

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

func (*SkeletonDescriptorAdapter) Create

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

func (*SkeletonDescriptorAdapter) Delete

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

func (*SkeletonDescriptorAdapter) Dependencies

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

func (*SkeletonDescriptorAdapter) DerivedValues

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

func (*SkeletonDescriptorAdapter) Retrieve

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

func (*SkeletonDescriptorAdapter) Update

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

func (*SkeletonDescriptorAdapter) UpdateWithRecreate

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

func (*SkeletonDescriptorAdapter) Validate

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

func (*SkeletonDescriptorAdapter) ValueComparator

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

type SkeletonKVWithMetadata

type SkeletonKVWithMetadata struct {
	Key      string
	Value    *model.ValueSkeleton
	Metadata interface{}
	Origin   ValueOrigin
}

Jump to

Keyboard shortcuts

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