nodes

package
v0.0.0-...-4aff305 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: GPL-3.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node interface {
	NodeResource

	// Insert defines a way to insert some members into the store that's associated
	// with the key
	Insert(selectors.Key, []selectors.FieldValueScore) <-chan selectors.Element

	// Delete removes a set of members associated with a key with in the store
	Delete(selectors.Key, []selectors.FieldValueScore) <-chan selectors.Element

	// Select retrieves a single element from the store
	Select(selectors.Key, selectors.Field) <-chan selectors.Element

	// Keys returns all the keys with in the store
	Keys() <-chan selectors.Element

	// Size defines a way to find the size associated with the key
	Size(selectors.Key) <-chan selectors.Element

	// Members defines a way to return all member keys associated with the key
	Members(selectors.Key) <-chan selectors.Element

	// Score returns the value of the field in a key
	Score(selectors.Key, selectors.Field) <-chan selectors.Element
}

Node describes a type that can communicate with various node implementations in a generic concurrent manor.

func NewNop

func NewNop() Node

NewNop creates a nop Node

func NewRemote

func NewRemote(transport api.Transport) Node

NewRemote creates a Node that communicates with a remote service

func NewVirtual

func NewVirtual(hash uint32, store store.Store) Node

NewVirtual creates a local storage

type NodeResource

type NodeResource interface {

	// Hash returns the transport unique hash
	Hash() uint32

	// Host returns the transport underlying host
	Host() string
}

NodeResource defines a hash and host

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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