Documentation ¶
Index ¶
- Constants
- func EndpointNames(jobName string) []string
- func GetLogger(ctx context.Context) *logger.Logger
- func JobsFromConfig(c *config.Config) ([]Job, *Connecter, error)
- type ActiveSide
- func (j *ActiveSide) Name() string
- func (j *ActiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
- func (j *ActiveSide) RegisterMetrics(registerer prometheus.Registerer)
- func (j *ActiveSide) Run(ctx context.Context, cron *cron.Cron) error
- func (j *ActiveSide) Runnable() bool
- func (j *ActiveSide) Running() (d time.Duration, ok bool)
- func (j *ActiveSide) SenderConfig() *endpoint.SenderConfig
- func (j *ActiveSide) Shutdown()
- func (j *ActiveSide) Status() *Status
- type ActiveSideState
- type ActiveSideStatus
- func (self *ActiveSideStatus) Cron() string
- func (self *ActiveSideStatus) Error() string
- func (self *ActiveSideStatus) Progress() (expected, completed uint64)
- func (self *ActiveSideStatus) Running() (d time.Duration, ok bool)
- func (self *ActiveSideStatus) SleepingUntil() time.Time
- func (self *ActiveSideStatus) Steps() (expected, step int)
- type Client
- func (self *Client) DestroySnapshots(ctx context.Context, req *pdu.DestroySnapshotsReq) (*pdu.DestroySnapshotsRes, error)
- func (self *Client) ListFilesystemVersions(ctx context.Context, req *pdu.ListFilesystemVersionsReq) (*pdu.ListFilesystemVersionsRes, error)
- func (self *Client) ListFilesystems(ctx context.Context) (*pdu.ListFilesystemRes, error)
- func (self *Client) Receive(ctx context.Context, req *pdu.ReceiveReq, receive io.ReadCloser) error
- func (self *Client) ReplicationCursor(ctx context.Context, req *pdu.ReplicationCursorReq) (*pdu.ReplicationCursorRes, error)
- func (self *Client) Send(ctx context.Context, req *pdu.SendReq) (*pdu.SendRes, io.ReadCloser, error)
- func (self *Client) SendCompleted(ctx context.Context, req *pdu.SendCompletedReq) error
- func (self *Client) SendDry(ctx context.Context, req *pdu.SendDryReq) (*pdu.SendDryRes, error)
- func (self *Client) WaitForConnectivity(ctx context.Context) error
- func (self *Client) WithTimeout(d time.Duration) *Client
- type Connected
- type Connecter
- type Endpoint
- type Hook
- type Internal
- type Job
- type JobStatus
- type LocalSender
- type PassiveSide
- func (j *PassiveSide) Endpoint(clientIdentity string) Endpoint
- func (j *PassiveSide) KnownClient(clientIdentity string) bool
- func (j *PassiveSide) Name() string
- func (j *PassiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
- func (*PassiveSide) RegisterMetrics(registerer prometheus.Registerer)
- func (j *PassiveSide) Run(ctx context.Context, cron *cron.Cron) error
- func (j *PassiveSide) Runnable() bool
- func (j *PassiveSide) SenderConfig() *endpoint.SenderConfig
- func (j *PassiveSide) Shutdown()
- func (s *PassiveSide) Status() *Status
- type PassiveStatus
- func (self *PassiveStatus) Cron() string
- func (self *PassiveStatus) Error() string
- func (self *PassiveStatus) Progress() (uint64, uint64)
- func (self *PassiveStatus) Running() (time.Duration, bool)
- func (self *PassiveStatus) SleepingUntil() time.Time
- func (self *PassiveStatus) Steps() (expected, step int)
- type ReceivingJobConfig
- type SendingJobConfig
- type SnapJob
- func (j *SnapJob) Name() string
- func (j *SnapJob) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
- func (j *SnapJob) RegisterMetrics(registerer prometheus.Registerer)
- func (j *SnapJob) Run(ctx context.Context, cron *cron.Cron) error
- func (j *SnapJob) Runnable() bool
- func (j *SnapJob) SenderConfig() *endpoint.SenderConfig
- func (j *SnapJob) Shutdown()
- func (j *SnapJob) Status() *Status
- func (j *SnapJob) Type() Type
- type SnapJobStatus
- func (self *SnapJobStatus) Cron() string
- func (self *SnapJobStatus) Error() string
- func (self *SnapJobStatus) Progress() (uint64, uint64)
- func (self *SnapJobStatus) Running() (d time.Duration, ok bool)
- func (self *SnapJobStatus) SleepingUntil() time.Time
- func (self *SnapJobStatus) Steps() (expected, step int)
- type Status
- func (s *Status) CanSignal() string
- func (s *Status) Cron() string
- func (s *Status) Error() string
- func (s *Status) Internal() bool
- func (s *Status) MarshalJSON() ([]byte, error)
- func (s *Status) Progress() (uint64, uint64)
- func (s *Status) Running() (time.Duration, bool)
- func (s *Status) SleepingUntil() time.Time
- func (s *Status) Steps() (expected, step int)
- func (s *Status) UnmarshalJSON(in []byte) (err error)
- type Type
Constants ¶
const ( EpListFilesystems = iota EpListFilesystemVersions EpDestroySnapshots EpWaitForConnectivity EpReceive EpSend EpSendDry EpSendCompleted EpReplicationCursor )
Variables ¶
This section is empty.
Functions ¶
func EndpointNames ¶ added in v0.9.0
Types ¶
type ActiveSide ¶
type ActiveSide struct {
// contains filtered or unexported fields
}
func (*ActiveSide) Name ¶
func (j *ActiveSide) Name() string
func (*ActiveSide) OwnedDatasetSubtreeRoot ¶
func (j *ActiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
func (*ActiveSide) RegisterMetrics ¶
func (j *ActiveSide) RegisterMetrics(registerer prometheus.Registerer)
func (*ActiveSide) Runnable ¶ added in v0.9.0
func (j *ActiveSide) Runnable() bool
func (*ActiveSide) SenderConfig ¶
func (j *ActiveSide) SenderConfig() *endpoint.SenderConfig
func (*ActiveSide) Shutdown ¶
func (j *ActiveSide) Shutdown()
func (*ActiveSide) Status ¶
func (j *ActiveSide) Status() *Status
type ActiveSideState ¶
type ActiveSideState int
const ( ActiveSideReplicating ActiveSideState = 1 << iota ActiveSidePruneSender ActiveSidePruneReceiver ActiveSideDone // also errors )
func ActiveSideStateString ¶
func ActiveSideStateString(s string) (ActiveSideState, error)
ActiveSideStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func ActiveSideStateValues ¶
func ActiveSideStateValues() []ActiveSideState
ActiveSideStateValues returns all values of the enum
func (ActiveSideState) IsAActiveSideState ¶
func (i ActiveSideState) IsAActiveSideState() bool
IsAActiveSideState returns "true" if the value is listed in the enum definition. "false" otherwise
func (ActiveSideState) String ¶
func (i ActiveSideState) String() string
type ActiveSideStatus ¶
type ActiveSideStatus struct { CronSpec string SleepUntil time.Time StartedAt time.Time Err string Replication *report.Report PruningSender, PruningReceiver *pruner.Report Snapshotting *snapper.Report }
func (*ActiveSideStatus) Cron ¶
func (self *ActiveSideStatus) Cron() string
func (*ActiveSideStatus) Error ¶
func (self *ActiveSideStatus) Error() string
func (*ActiveSideStatus) Progress ¶
func (self *ActiveSideStatus) Progress() (expected, completed uint64)
func (*ActiveSideStatus) Running ¶
func (self *ActiveSideStatus) Running() (d time.Duration, ok bool)
func (*ActiveSideStatus) SleepingUntil ¶
func (self *ActiveSideStatus) SleepingUntil() time.Time
func (*ActiveSideStatus) Steps ¶
func (self *ActiveSideStatus) Steps() (expected, step int)
type Client ¶ added in v0.9.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DestroySnapshots ¶ added in v0.9.0
func (self *Client) DestroySnapshots(ctx context.Context, req *pdu.DestroySnapshotsReq, ) (*pdu.DestroySnapshotsRes, error)
func (*Client) ListFilesystemVersions ¶ added in v0.9.0
func (self *Client) ListFilesystemVersions(ctx context.Context, req *pdu.ListFilesystemVersionsReq, ) (*pdu.ListFilesystemVersionsRes, error)
func (*Client) ListFilesystems ¶ added in v0.9.0
func (*Client) Receive ¶ added in v0.9.0
func (self *Client) Receive(ctx context.Context, req *pdu.ReceiveReq, receive io.ReadCloser, ) error
func (*Client) ReplicationCursor ¶ added in v0.9.0
func (self *Client) ReplicationCursor(ctx context.Context, req *pdu.ReplicationCursorReq, ) (*pdu.ReplicationCursorRes, error)
func (*Client) SendCompleted ¶ added in v0.9.0
func (*Client) SendDry ¶ added in v0.9.0
func (self *Client) SendDry(ctx context.Context, req *pdu.SendDryReq, ) (*pdu.SendDryRes, error)
func (*Client) WaitForConnectivity ¶ added in v0.9.0
type Connecter ¶ added in v0.9.0
type Connecter struct {
// contains filtered or unexported fields
}
func NewConnecter ¶ added in v0.9.0
func (*Connecter) AddJob ¶ added in v0.9.0
func (self *Connecter) AddJob(listnerName string, j *PassiveSide)
func (*Connecter) FromConfig ¶ added in v0.9.0
func (*Connecter) Job ¶ added in v0.9.0
func (self *Connecter) Job(name string) *PassiveSide
type Hook ¶ added in v0.8.10
type Hook struct {
// contains filtered or unexported fields
}
func NewHookFromConfig ¶ added in v0.8.10
func NewHookFromConfig(in *config.HookCommand) *Hook
func (*Hook) ErrIsFatal ¶ added in v0.8.10
func (*Hook) WithPostHook ¶ added in v0.8.10
type Internal ¶
type Internal interface { Run(ctx context.Context, cron *cron.Cron) error RegisterMetrics(registerer prometheus.Registerer) Shutdown() }
type Job ¶
type Job interface { Internal Name() string Status() *Status // Jobs that return a subtree of the dataset hierarchy // must return the root of that subtree as rfs and ok = true OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool) SenderConfig() *endpoint.SenderConfig Runnable() bool }
type LocalSender ¶ added in v0.9.2
type LocalSender struct { // the Target passed as Target to BuildLocalPruner pruner.Target // contains filtered or unexported fields }
func NewLocalSender ¶ added in v0.9.2
func NewLocalSender(ctx context.Context, target pruner.Target) *LocalSender
Adaptor that implements pruner.History around a pruner.Target. The ReplicationCursor method is Get-op only and always returns the filesystem's most recent version's GUID.
TODO: This is a work-around for the current package daemon/pruner and package pruning.Snapshot limitation: they require the `Replicated` getter method be present, but obviously, a local job like SnapJob can't deliver on that. But the pruner.Pruner gives up on an FS if no replication cursor is present, which is why this pruner returns the most recent filesystem version.
func (*LocalSender) ListFilesystems ¶ added in v0.9.2
func (self *LocalSender) ListFilesystems(ctx context.Context, ) (*pdu.ListFilesystemRes, error)
func (*LocalSender) ReplicationCursor ¶ added in v0.9.2
func (self *LocalSender) ReplicationCursor(ctx context.Context, req *pdu.ReplicationCursorReq, ) (*pdu.ReplicationCursorRes, error)
type PassiveSide ¶
type PassiveSide struct {
// contains filtered or unexported fields
}
func (*PassiveSide) Endpoint ¶ added in v0.9.0
func (j *PassiveSide) Endpoint(clientIdentity string) Endpoint
func (*PassiveSide) KnownClient ¶ added in v0.9.0
func (j *PassiveSide) KnownClient(clientIdentity string) bool
func (*PassiveSide) Name ¶
func (j *PassiveSide) Name() string
func (*PassiveSide) OwnedDatasetSubtreeRoot ¶
func (j *PassiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool, )
func (*PassiveSide) RegisterMetrics ¶
func (*PassiveSide) RegisterMetrics(registerer prometheus.Registerer)
func (*PassiveSide) Runnable ¶ added in v0.9.0
func (j *PassiveSide) Runnable() bool
func (*PassiveSide) SenderConfig ¶
func (j *PassiveSide) SenderConfig() *endpoint.SenderConfig
func (*PassiveSide) Shutdown ¶
func (j *PassiveSide) Shutdown()
func (*PassiveSide) Status ¶
func (s *PassiveSide) Status() *Status
type PassiveStatus ¶
func (*PassiveStatus) Cron ¶
func (self *PassiveStatus) Cron() string
func (*PassiveStatus) Error ¶
func (self *PassiveStatus) Error() string
func (*PassiveStatus) Progress ¶
func (self *PassiveStatus) Progress() (uint64, uint64)
func (*PassiveStatus) SleepingUntil ¶
func (self *PassiveStatus) SleepingUntil() time.Time
func (*PassiveStatus) Steps ¶
func (self *PassiveStatus) Steps() (expected, step int)
type ReceivingJobConfig ¶
type ReceivingJobConfig interface { GetRootFS() string GetAppendClientIdentity() bool GetRecvOptions() *config.RecvOptions }
type SendingJobConfig ¶
type SendingJobConfig interface { GetFilesystems() (config.FilesystemsFilter, []config.DatasetFilter) GetSendOptions() *config.SendOptions // must not be nil }
type SnapJob ¶
type SnapJob struct {
// contains filtered or unexported fields
}
func (*SnapJob) OwnedDatasetSubtreeRoot ¶
func (j *SnapJob) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
func (*SnapJob) RegisterMetrics ¶
func (j *SnapJob) RegisterMetrics(registerer prometheus.Registerer)
func (*SnapJob) SenderConfig ¶
func (j *SnapJob) SenderConfig() *endpoint.SenderConfig
type SnapJobStatus ¶
func (*SnapJobStatus) Cron ¶
func (self *SnapJobStatus) Cron() string
func (*SnapJobStatus) Error ¶
func (self *SnapJobStatus) Error() string
func (*SnapJobStatus) Progress ¶
func (self *SnapJobStatus) Progress() (uint64, uint64)
func (*SnapJobStatus) SleepingUntil ¶
func (self *SnapJobStatus) SleepingUntil() time.Time
func (*SnapJobStatus) Steps ¶
func (self *SnapJobStatus) Steps() (expected, step int)