Documentation
¶
Overview ¶
Package director contains: actions.go - agent.go - director.go - slave.go
Actions provides the functions to resolve the action to do ¶
Package director contains: actions.go - agent.go - director.go - slave.go
Agent executes the orders received from director ¶
Package director contains: actions.go - agent.go - director.go - slave.go
Director sends an order to the agent Make orders from synchronisation between nodes
Package director contains: agent.go - consul.go - director.go - server.go - slave.go
Slave receives a snapshot from agent
Index ¶
- Constants
- func Delete(dataset string, DeleteList []string, prefix string, retention []string) (bool, []string)
- func Director()
- func HandleRequestAgent(ConnAgent net.Conn)
- func HandleRequestSlave(ConnSlave net.Conn)
- func NewSnapshot(TakeList []string, cron string, prefix string) (bool, string)
- func Send(dataset string, SentList []string, SyncPolicy string, prefix string) (bool, string)
- type ZFSDirectorsOrder
- type ZFSListUUIDsFromSlave
- type ZFSListUUIDsToAgent
- type ZFSOrderFromAgent
- type ZFSOrderToSlave
- type ZFSResponseFromSlave
- type ZFSResponseToAgent
Constants ¶
const ( DatasetTrue = iota + 1 // Dataset not empty DatasetFalse // Dataset does not exist or empty DatasetDisable // Dataset disabled DatasetDocker // Dataset docker DatasetNotConf // Dataset not configured )
Status for DestDataset
const ( WasRenamed = iota + 1 // The snapshot sent was renamed on destination WasWritten // The snapshot sent was written on destination NothingToDo // The snapshot sent already existed on destination Zerror // Any error string NotEmpty // Need an incremental stream Incremental // Ready to send an incremental stream MostActual // The last snapshot on destination is the most actual )
Status for response
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(dataset string, DeleteList []string, prefix string, retention []string) (bool, []string)
Delete returns true if the snapshot should be deleted
func Director ¶
func Director()
Director reads the server config file and all KV pairs Then it creates the orders
func HandleRequestAgent ¶
HandleRequestAgent incoming requests from director
func HandleRequestSlave ¶
HandleRequestSlave incoming requests from agent
func NewSnapshot ¶
NewSnapshot returns true if a new snapshot should be created and its name
Types ¶
type ZFSDirectorsOrder ¶
type ZFSDirectorsOrder struct { OrderUUID string `json:"OrderUUID"` // Mandatory Action string `json:"Action"` // take_snapshot, send_snapshot, destroy_snapshot Destination string `json:"Destination"` // Hostname or IP for send SnapshotUUID []string `json:"SnapshotUUID"` // List of snapshots SnapshotName string `json:"SnapshotName"` // Name of snapshot for take_snapshot order DestDataset string `json:"DestDataset"` // Dataset for receive RollbackIfNeeded bool `json:"RollbackIfNeeded"` // Should I rollback if written is true on destination SkipIfRenamed bool `json:"SkipIfRenamed"` // Should I do the stuff if a snapshot has been renamed SkipIfNotWritten bool `json:"SkipIfNotWritten"` // Should I take a snapshot if nothing is written SkipIfCloned bool `json:"SkipIfCloned"` // Should I delete a snapshot if it was cloned }
ZFSDirectorsOrder is the struct for the director's orders
type ZFSListUUIDsFromSlave ¶
type ZFSListUUIDsFromSlave struct {
MapUUID []string // map of uuids
}
ZFSListUUIDsFromSlave is the struct to receive the list of uuids in DestDataset
type ZFSListUUIDsToAgent ¶
type ZFSListUUIDsToAgent struct {
MapUUID []string `json:"MapUUID"`
}
ZFSListUUIDsToAgent is the struct to send the list of uuids in dataset
type ZFSOrderFromAgent ¶
type ZFSOrderFromAgent struct { Source string // hostname of agent OrderUUID string // mandatory SnapshotUUID string // uuid of snapshot received SnapshotName string // name of snapshot received DestDataset string // dataset for receive }
ZFSOrderFromAgent is the struct for ZFS orders from agent
type ZFSOrderToSlave ¶
type ZFSOrderToSlave struct { Hostname string `json:"Source"` OrderUUID string `json:"OrderUUID"` SnapshotUUID string `json:"SnapshotUUID"` SnapshotName string `json:"SnapshotName"` DestDataset string `json:"DestDataset"` }
ZFSOrderToSlave is the struct for ZFS orders to slave