cluster

package
v0.0.0-...-b7f82e1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPartialInsertions    = typex.Errorf(errors.Source, errors.Partial, "Partial Insertions")
	ErrPartialModifications = typex.Errorf(errors.Source, errors.Partial, "Partial Modifications")
	ErrPartialDeletions     = typex.Errorf(errors.Source, errors.Partial, "Partial Deletions")
)

ErrPartialInsertions defines an error where insertions happened, but no redis error replied, yet the number of actual insertions didn't match the number of required insertions.

Functions

func AmountFromElement

func AmountFromElement(e Element) int

AmountFromElement attempts to get an amount from the element if it exists.

func ErrorFromElement

func ErrorFromElement(e Element) error

ErrorFromElement attempts to get an error from the element if it exists.

func KeyFieldScoreSizeExpiryFromElement

func KeyFieldScoreSizeExpiryFromElement(e Element) s.KeyFieldScoreSizeExpiry

KeyFieldScoreSizeExpiryFromElement attempts to get an key score members from the element if it exists.

func KeysFromElement

func KeysFromElement(e Element) []bs.Key

KeysFromElement attempts to get an key score members from the element if it exists.

func ValuesFromElement

func ValuesFromElement(e Element) []s.KeyFieldScoreTxnValue

ValuesFromElement attempts to get an key score members from the element if it exists.

Types

type Closer

type Closer interface {
	Close() error
}

Closer closes the current cluster along with any underlying pools.

type CountElement

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

CountElement defines a struct that is a container for counting items (possible changes or just returning an int)

func NewCountElement

func NewCountElement(key bs.Key, amount int) *CountElement

NewCountElement creates a new CountElement

func (*CountElement) Amount

func (e *CountElement) Amount() int

Amount defines the amount associated with the CountElement

func (*CountElement) Key

func (e *CountElement) Key() bs.Key

Key defines the key associated with the CountElement

func (*CountElement) Type

func (e *CountElement) Type() ElementType

Type defines the type associated with the CountElement

type Deleter

type Deleter interface {
	Delete([]s.KeyFieldScoreTxnValue, s.KeySizeExpiry) <-chan Element
	Rollback([]s.KeyFieldScoreTxnValue, s.KeySizeExpiry) <-chan Element
}

Deleter represents a way to delete a mass collection of members in to the store. This is slightly different setup to the selectors interface to enable better concurrency.

type Element

type Element interface {
	Key() bs.Key
	Type() ElementType
}

Element combines a submitted key with the resulting values. If there was an error while selecting a key, the error field will be populated.

type ElementType

type ElementType int

ElementType defines the type of element to expect over the wire.

const (
	ErrorElementType ElementType = iota
	KeyElementType
	KeyFieldSizeElementType
	KeyFieldScoreTxnValueType
	KeyFieldScoreSizeExpiryType
	CountElementType
)

KeyFieldScoreTxnValueType and the following defines all the types you can expect when interacting with a Element.

type ErrorElement

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

ErrorElement defines a struct that is a container for errors.

func NewErrorElement

func NewErrorElement(key bs.Key, err error) *ErrorElement

NewErrorElement creates a new ErrorElement

func (*ErrorElement) Error

func (e *ErrorElement) Error() error

Error defines the error associated with the ErrorElement

func (*ErrorElement) Key

func (e *ErrorElement) Key() bs.Key

Key defines the key associated with the ErrorElement

func (*ErrorElement) Type

func (e *ErrorElement) Type() ElementType

Type defines the type associated with the ErrorElement

type Inserter

type Inserter interface {
	Insert([]s.KeyFieldScoreTxnValue, s.KeySizeExpiry) <-chan Element
}

Inserter represents a way to insert a mass collection of members in to the store. This is slightly different setup to the selectors interface to enable better concurrency.

type KeyElement

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

KeyElement defines a struct that is a container for members with in the store.

func NewKeyElement

func NewKeyElement(key bs.Key, keys []bs.Key) *KeyElement

NewKeyElement creates a new KeyElement

func (*KeyElement) Key

func (e *KeyElement) Key() bs.Key

Key defines the key associated with the KeyElement

func (*KeyElement) Keys

func (e *KeyElement) Keys() []bs.Key

Keys defines the key associated with the KeyElement

func (*KeyElement) Type

func (e *KeyElement) Type() ElementType

Type defines the type associated with the KeyElement

type KeyFieldScoreSizeExpiryElement

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

KeyFieldScoreSizeExpiryElement defines a struct that is a container for members with in the store.

func NewKeyFieldScoreSizeExpiryElement

func NewKeyFieldScoreSizeExpiryElement(keyFieldScoreSizeExpiry s.KeyFieldScoreSizeExpiry) *KeyFieldScoreSizeExpiryElement

NewKeyFieldScoreSizeExpiryElement creates a new KeyFieldScoreSizeExpiryElement

func (*KeyFieldScoreSizeExpiryElement) Key

Key defines the key associated with the KeyFieldScoreSizeExpiryElement

func (*KeyFieldScoreSizeExpiryElement) KeyFieldScoreSizeExpiry

func (e *KeyFieldScoreSizeExpiryElement) KeyFieldScoreSizeExpiry() s.KeyFieldScoreSizeExpiry

KeyFieldScoreSizeExpiry defines the type associated with the KeyFieldScoreSizeExpiryElement

func (*KeyFieldScoreSizeExpiryElement) Type

Type defines the type associated with the KeyFieldScoreSizeExpiryElement

type KeyFieldScoreTxnValue

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

KeyFieldScoreTxnValue defines a struct that is a container for members with in the store.

func NewKeyFieldScoreTxnValue

func NewKeyFieldScoreTxnValue(key bs.Key,
	members []s.KeyFieldScoreTxnValue,
) *KeyFieldScoreTxnValue

NewKeyFieldScoreTxnValue creates a new KeyFieldScoreTxnValue

func (*KeyFieldScoreTxnValue) Key

func (e *KeyFieldScoreTxnValue) Key() bs.Key

Key defines the key associated with the KeyFieldScoreTxnValue

func (*KeyFieldScoreTxnValue) Members

Members defines the members associated with the KeyFieldScoreTxnValue

func (*KeyFieldScoreTxnValue) Type

Type defines the type associated with the KeyFieldScoreTxnValue

type Modifier

type Modifier interface {
	Modify([]s.KeyFieldScoreTxnValue, s.KeySizeExpiry) <-chan Element
}

Modifier represents a way to insert a mass collection of members in to the store. This is slightly different setup to the selectors interface to enable better concurrency.

type Notifier

type Notifier interface {
	Publish(s.Channel, []s.KeyFieldScoreSizeExpiry) <-chan Element
	Unpublish(s.Channel, []s.KeyFieldScoreSizeExpiry) <-chan Element
	Subscribe(s.Channel) <-chan Element
}

Notifier defines a way to publish various messages to a channel

type Repairer

type Repairer interface {
	Repair([]s.KeyFieldScoreTxnValue, s.KeySizeExpiry) <-chan Element
}

Repairer defines a way to *attempt* to repair the collection, if possible.

type Scanner

type Scanner interface {
	Keys() <-chan Element
	Size(bs.Key) <-chan Element
	Members(bs.Key) <-chan Element
}

Scanner represents a way to introspect the store to help understand what the store has with in it's collections.

type Scorer

type Scorer interface {
	Score([]s.KeyFieldTxnValue) (map[s.KeyFieldTxnValue]s.Presence, error)
}

Scorer defines a way to score members with in the collection.

type Selector

type Selector interface {
	Select(bs.Key, bs.Key) <-chan Element
	SelectRange(bs.Key, int, s.KeySizeExpiry) <-chan Element
}

Selector defines a way to select members from the store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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