snapshot

package
v0.0.0-...-88aa921 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recv

func Recv(conn client.Connection, nodeID string, snapshot *Snapshot) error

Recv waits for a snapshot to be complete

func Send

func Send(conn client.Connection, serviceID string) (string, error)

Send sends a new snapshot request to the queue

Types

type Snapshot

type Snapshot struct {
	ServiceID string
	Label     string
	Err       string
	// contains filtered or unexported fields
}

Snapshot is the snapshot request object

func (*Snapshot) SetVersion

func (s *Snapshot) SetVersion(version interface{})

SetVersion implements client.Node

func (*Snapshot) Version

func (s *Snapshot) Version() interface{}

Version implements client.Node

type SnapshotHandler

type SnapshotHandler interface {
	TakeSnapshot(serviceID string) (label string, err error)
}

SnapshotHandler is the handler interface for running a snapshot listener

type SnapshotListener

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

SnapshotListener is the zk listener for snapshots

func NewSnapshotListener

func NewSnapshotListener(handler SnapshotHandler) *SnapshotListener

NewSnapshotListener instantiates a new listener for snapshots

func (*SnapshotListener) Done

func (l *SnapshotListener) Done()

Done implements zzk.Listener

func (*SnapshotListener) GetPath

func (l *SnapshotListener) GetPath(nodes ...string) string

GetPath implements zzk.Listener

func (*SnapshotListener) PostProcess

func (l *SnapshotListener) PostProcess(p map[string]struct{})

PostProcess implements zzk.Listener

func (*SnapshotListener) Ready

func (l *SnapshotListener) Ready() (err error)

Ready implements zzk.Listener

func (*SnapshotListener) SetConnection

func (l *SnapshotListener) SetConnection(conn client.Connection)

SetConnection implements zzk.Listener

func (*SnapshotListener) Spawn

func (l *SnapshotListener) Spawn(shutdown <-chan interface{}, nodeID string)

Spawn takes a snapshot of a service and waits for the node to be deleted. If the node is not removed, then no action is performed.

Jump to

Keyboard shortcuts

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