ring

package
v0.0.0-...-7ceab97 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2014 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomPos

func RandomPos(octets int) (result []byte)

Types

type Peer

type Peer struct {
	Name             string
	Pos              []byte
	ConnectionString string
}

func (*Peer) Call

func (self *Peer) Call(method string, input interface{}, output interface{}) error

func (*Peer) Equal

func (self *Peer) Equal(o *Peer) bool

func (*Peer) Go

func (self *Peer) Go(method string, args, reply interface{}, done chan *rpc.Call) (call *rpc.Call)

func (*Peer) String

func (self *Peer) String() string

type Peers

type Peers []*Peer

func (Peers) ContainsPos

func (self Peers) ContainsPos(pos []byte) bool

func (Peers) Len

func (self Peers) Len() int

func (Peers) Less

func (self Peers) Less(i, j int) bool

func (Peers) Swap

func (self Peers) Swap(i, j int)

type Ring

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

func New

func New() *Ring

func (*Ring) AddPeer

func (self *Ring) AddPeer(peer *Peer)

func (*Ring) ByName

func (self *Ring) ByName(name string) (result *Peer, found bool)

func (*Ring) Clone

func (self *Ring) Clone() (result *Ring)

func (*Ring) Each

func (self *Ring) Each(f func(*Peer))

func (*Ring) Equal

func (self *Ring) Equal(o *Ring) bool

func (*Ring) Len

func (self *Ring) Len() int

func (*Ring) MarshalBinary

func (self *Ring) MarshalBinary() (b []byte, err error)

func (*Ring) MarshalText

func (self *Ring) MarshalText() (b []byte, err error)

func (*Ring) Predecessors

func (self *Ring) Predecessors(pos []byte, n int) (result Peers)

func (*Ring) Rand

func (self *Ring) Rand() (result *Peer)

func (*Ring) RemovePeer

func (self *Ring) RemovePeer(name string)

func (*Ring) String

func (self *Ring) String() string

func (*Ring) Successors

func (self *Ring) Successors(pos []byte, n int) (result Peers)

func (*Ring) UnmarshalBinary

func (self *Ring) UnmarshalBinary(b []byte) (err error)

func (*Ring) UnmarshalText

func (self *Ring) UnmarshalText(b []byte) (err error)

Jump to

Keyboard shortcuts

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