interfaces

package
v0.0.0-...-02cf16a Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2015 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataTransformFunc

type DataTransformFunc func(data interface{}) interface{}

type IdDataCache

type IdDataCache interface {
	Put(id types.Id, fieldId int, data interface{})
	LockedTransform(id types.Id, fieldId int, fun DataTransformFunc)
	Lookup(id types.Id, fieldId int) interface{}
}

type IdMap

type IdMap interface {
	// Does nothing and returns false if the mapping already exists
	Insert(key types.Id, value types.Id) (inserted bool, err types.Error)
	// Does nothing and returns false if the mapping doesn't already exist
	Replace(key types.Id, value types.Id) (replaced bool, err types.Error)
	// Inserts or replaces as needed
	Put(key types.Id, value types.Id) types.Error
	// Does noting and returns false if the mapping doesn't exist
	Delete(key types.Id, value types.Id) (deleted bool, err types.Error)
	Lookup(key types.Id) (*types.Id, types.Error)
	ReverseLookup(value types.Id) ([]types.Id, types.Error)
}

type IdMultiMap

type IdMultiMap interface {
	// Stores a key-value pair in the map, returns true of the mapping didn't already exist
	Put(key types.Id, value types.Id) (inserted bool, err types.Error)
	// Removes a mapping from the map, returns true if the mapping existed
	Delete(key types.Id, value types.Id) (deleted bool, err types.Error)
	// Returns true if the given key/value pair exists in the map
	Contains(key types.Id, value types.Id) (exists bool, err types.Error)

	Lookup(key types.Id) ([]types.Id, types.Error)
	ReverseLookup(value types.Id) ([]types.Id, types.Error)
}

type State

type State interface {
	Key() string
	Value() []byte
}

type StateStore

type StateStore interface {
	CreateBucket(types.Id) (exists bool, err types.Error)
	BucketExists(types.Id) (exists bool, err types.Error)
	SetState(id types.Id, key string, value []byte) (oldValue []byte, err types.Error)
	State(id types.Id, key string) (value []byte, err types.Error)
	States(id types.Id) ([]State, types.Error)
}

Jump to

Keyboard shortcuts

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