coordinator

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: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Match   selectors.Op = "match"
	Replace selectors.Op = "replace"
)

Match and Replace define possible operations for patching queries

Variables

View Source
var (
	ErrPartialInsertionFailure = typex.Errorf(errors.Source, errors.Partial, "Partial Insertion Failure")
	ErrPartialDeletionFailure  = typex.Errorf(errors.Source, errors.Partial, "Partial Deletion Failure")
	ErrPartialRollbackFailure  = typex.Errorf(errors.Source, errors.Partial, "Partial Rollback Failure")
)

Functions

func NewCoordinatorAccessor

func NewCoordinatorAccessor(co *Coordinator) *coordinatorAccessor

Types

type Coordinator

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

Coordinator defines a single point for accessing the data store.

func New

func New(e *env.Env, transformer s.Transformer, accessor s.Accessor) *Coordinator

New defines a way to create a new Coordinator. It knits all the farms together to make sure the Coordinator can work, if something is missing the Coordinator will log out the error then exit.

func (*Coordinator) Delete

func (co *Coordinator) Delete(values []s.KeyFieldScoreTxnValue, maxSize s.KeySizeExpiry) (res int, err error)

Delete represents a way to delete various values into the store.

func (*Coordinator) Insert

func (co *Coordinator) Insert(values []s.KeyFieldScoreTxnValue, maxSize s.KeySizeExpiry) (res int, err error)

Insert represents a way to insert various values into the store.

func (*Coordinator) Keys

func (co *Coordinator) Keys() (res []bs.Key, err error)

Keys defines a way to query the store for all the keys with in it.

func (*Coordinator) Lock

func (co *Coordinator) Lock(ns b.Namespace) (b.SemaphoreUnlock, error)

func (*Coordinator) Members

func (co *Coordinator) Members(key bs.Key) (res []bs.Key, err error)

Members represents all the items with in the store for a particular key.

func (*Coordinator) Modify

func (co *Coordinator) Modify(values []s.KeyFieldScoreTxnValue, maxSize s.KeySizeExpiry) (res int, err error)

Modify represents a way to modify various values into the store.

func (*Coordinator) ModifyWithOperations

func (co *Coordinator) ModifyWithOperations(key, id bs.Key, ops []s.Operation, score float64, maxSize s.SizeExpiry) (res int, err error)

ModifyWithOperations represents a way to modify various values into the store.

func (*Coordinator) Pause

func (co *Coordinator) Pause()

Pause the coordinator

func (*Coordinator) Query

func (co *Coordinator) Query(key bs.Key,
	options s.QueryOptions,
	maxSize s.SizeExpiry,
) (res []s.QueryRecord, err error)

Query defines a way to request a possible query of the store of a particular key.

func (*Coordinator) Quit

func (co *Coordinator) Quit()

func (*Coordinator) Repair

func (co *Coordinator) Repair(elements []s.KeyFieldTxnValue, maxSize s.KeySizeExpiry) (err error)

Repair defines a way to request a possible repair of the store of a particular key.

func (*Coordinator) Resume

func (co *Coordinator) Resume()

Resume the coordinator

func (*Coordinator) Rollback

func (co *Coordinator) Rollback(values []s.KeyFieldScoreTxnValue, maxSize s.KeySizeExpiry) (err error)

Rollback represents a way to rollback various values into the store.

func (*Coordinator) Select

func (co *Coordinator) Select(key, field bs.Key) (res s.KeyFieldScoreTxnValue, err error)

Select represents a way to request and select a member from the store.

func (*Coordinator) SelectRange

func (co *Coordinator) SelectRange(key bs.Key, limit int, maxSize s.KeySizeExpiry) (res []s.KeyFieldScoreTxnValue, err error)

SelectRange represents a way to request and select a range of members from the store that are under a certain limit.

func (*Coordinator) Size

func (co *Coordinator) Size(key bs.Key) (res int, err error)

Size returns the size of the collection with in the store.

func (*Coordinator) Topology

func (co *Coordinator) Topology(e *env.Env) error

Topology reloads the coordinator with all the various new strategies.

type LifeCycleService

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

LifeCycleService is aims to manage the basic shutdown of a service. With the idea that it knows about how many users are currently active with in it.

func (*LifeCycleService) Empty

func (c *LifeCycleService) Empty() bool

func (*LifeCycleService) In

func (c *LifeCycleService) In()

func (*LifeCycleService) Out

func (c *LifeCycleService) Out()

func (*LifeCycleService) Quit

func (c *LifeCycleService) Quit() (err error)

type Requester

type Requester interface {
	Request(elements map[string][]string,
		amount int,
		info map[string]interface{},
	) (map[string][]interface{}, error)
}

Requester defines a standardised way of requesting for items found within the data store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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