Documentation ¶
Index ¶
- Constants
- func BytesAddOne(in []byte) ([]byte, interface{}, error)
- func BytesToUint64(b []byte) uint64
- func MkKey(s ...string) string
- func Uint64ToBytes(x uint64) []byte
- func Uint64ToHex(x uint64) string
- type AtomicModifyFunc
- type Etcd
- func (c *Etcd) AtomicModifyKey(k []byte, f AtomicModifyFunc) (interface{}, error)
- func (e *Etcd) Close() error
- func (c *Etcd) CommitINodeIndex(vid torus.VolumeID) (torus.INodeID, error)
- func (c *Etcd) DumpMetadata(w io.Writer) error
- func (c *Etcd) GetINodeIndex(vid torus.VolumeID) (torus.INodeID, error)
- func (c *Etcd) GetLease() (int64, error)
- func (c *Etcd) GetLockStatus(vid uint64) string
- func (c *Etcd) GetPeers() (torus.PeerInfoList, error)
- func (c *Etcd) GetRing() (torus.Ring, error)
- func (c *Etcd) GetVolume(volume string) (*models.Volume, error)
- func (c *Etcd) GetVolumes() ([]*models.Volume, torus.VolumeID, error)
- func (c *Etcd) GlobalMetadata() torus.GlobalMetadata
- func (e *Etcd) Kind() torus.MetadataKind
- func (c *Etcd) NewVolumeID() (torus.VolumeID, error)
- func (c *Etcd) RegisterPeer(lease int64, p *models.PeerInfo) error
- func (c *Etcd) RenewLease(lease int64) error
- func (c *Etcd) SetRing(ring torus.Ring) error
- func (e *Etcd) SubscribeNewRings(ch chan torus.Ring)
- func (c *Etcd) UUID() string
- func (e *Etcd) UnsubscribeNewRings(ch chan torus.Ring)
- func (e *Etcd) WithContext(ctx context.Context) torus.MetadataService
Constants ¶
View Source
const (
KeyPrefix = "/github.com/alternative-storage/torus/"
)
Variables ¶
This section is empty.
Functions ¶
func BytesAddOne ¶
func BytesToUint64 ¶
func Uint64ToBytes ¶
func Uint64ToHex ¶
Types ¶
type AtomicModifyFunc ¶
AtomicModifyFunc is a class of commutative functions that, given the current state of a key's value `in`, returns the new state of the key `out`, and `data` to be returned to the calling function on success, or an `err`.
This function may be run multiple times, if the value has changed in the time between getting the data and setting the new value.
type Etcd ¶
func (*Etcd) AtomicModifyKey ¶
func (c *Etcd) AtomicModifyKey(k []byte, f AtomicModifyFunc) (interface{}, error)
TODO(barakmich): Perhaps make this an etcd client library function.
func (*Etcd) CommitINodeIndex ¶
func (*Etcd) DumpMetadata ¶
func (*Etcd) GetINodeIndex ¶
func (*Etcd) GetLockStatus ¶
func (*Etcd) GetPeers ¶
func (c *Etcd) GetPeers() (torus.PeerInfoList, error)
func (*Etcd) GlobalMetadata ¶
func (c *Etcd) GlobalMetadata() torus.GlobalMetadata
func (*Etcd) Kind ¶
func (e *Etcd) Kind() torus.MetadataKind
func (*Etcd) NewVolumeID ¶
func (*Etcd) RenewLease ¶
func (*Etcd) SubscribeNewRings ¶
func (*Etcd) UnsubscribeNewRings ¶
func (*Etcd) WithContext ¶
func (e *Etcd) WithContext(ctx context.Context) torus.MetadataService
Click to show internal directories.
Click to hide internal directories.