d2hop

package
v0.0.0-...-8448112 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2016 License: BSD-3-Clause, BSD-2-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyHash = "fnv1a"

Functions

This section is empty.

Types

type Conf

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

type ConfEntry

type ConfEntry LocalEntry

func (*ConfEntry) Atomic

func (e *ConfEntry) Atomic(key string, op uint16, values [][]byte) (ver uint64, retvals [][]byte, err error)

func (*ConfEntry) Get

func (e *ConfEntry) Get(key string, version uint64) (ver uint64, val []byte, err error)

type Conn

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

Represents client connection, both from a client, or another server. If from client, the clnt field is nil.

func (*Conn) Atomic

func (c *Conn) Atomic(key string, op uint16, values [][]byte) (ver uint64, vals [][]byte, err error)

func (*Conn) Create

func (c *Conn) Create(key, flags string, value []byte) (version uint64, err error)

func (*Conn) Get

func (c *Conn) Get(key string, version uint64) (ver uint64, val []byte, err error)

func (*Conn) Remove

func (c *Conn) Remove(key string) (err error)

func (*Conn) Set

func (c *Conn) Set(key string, value []byte) (ver uint64, err error)

func (*Conn) TestSet

func (c *Conn) TestSet(key string, oldversion uint64, oldvalue, value []byte) (ver uint64, val []byte, err error)

type D2Hop

type D2Hop struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Connect

func Connect(proto, addr string) (*D2Hop, error)

func NewD2Hop

func NewD2Hop(proto, listenaddr, masteraddr string, hop hop.Hop, hashes []Hash) (s *D2Hop, err error)

func (*D2Hop) Atomic

func (s *D2Hop) Atomic(key string, op uint16, values [][]byte) (ver uint64, vals [][]byte, err error)

func (*D2Hop) Close

func (s *D2Hop) Close()

func (*D2Hop) ConnClosed

func (s *D2Hop) ConnClosed(c *hopsrv.Conn)

func (*D2Hop) ConnOpened

func (s *D2Hop) ConnOpened(c *hopsrv.Conn)

func (*D2Hop) Connection

func (s *D2Hop) Connection() rmt.Conn

func (*D2Hop) Create

func (s *D2Hop) Create(key, flags string, value []byte) (version uint64, err error)

func (*D2Hop) Get

func (s *D2Hop) Get(key string, version uint64) (ver uint64, val []byte, err error)

func (*D2Hop) Remove

func (s *D2Hop) Remove(key string) (err error)

func (*D2Hop) Set

func (s *D2Hop) Set(key string, value []byte) (ver uint64, err error)

func (*D2Hop) SetDebugLevel

func (s *D2Hop) SetDebugLevel(n int)

make D2Hop implement the RemoteHop interface

func (*D2Hop) SetLogger

func (s *D2Hop) SetLogger(l *hop.Logger)

func (*D2Hop) TestSet

func (s *D2Hop) TestSet(key string, oldversion uint64, oldvalue, value []byte) (ver uint64, val []byte, err error)

type Hash

type Hash interface {
	New() hash.Hash32
	Name() string
}

type KeyHash

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

func GetKeyHash

func GetKeyHash(hashname string) *KeyHash

func (*KeyHash) Hash

func (kh *KeyHash) Hash(key string) (hcode uint32)

func (*KeyHash) Name

func (kh *KeyHash) Name() string

type KeysEntry

type KeysEntry LocalEntry

func (*KeysEntry) Get

func (e *KeysEntry) Get(key string, version uint64) (ver uint64, val []byte, err error)

type LocalEntry

type LocalEntry struct {
	hop.Entry
	// contains filtered or unexported fields
}

type Range

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

type RangeList

type RangeList []Range

func (RangeList) Len

func (rl RangeList) Len() int

func (RangeList) Less

func (rl RangeList) Less(i, j int) bool

func (RangeList) Search

func (rl RangeList) Search(hash uint32) *Range

func (RangeList) Swap

func (rl RangeList) Swap(i, j int)

type StackEntry

type StackEntry LocalEntry

func (*StackEntry) Get

func (e *StackEntry) Get(key string, version uint64) (ver uint64, val []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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