Documentation
¶
Index ¶
- Constants
- func EndpointNames(jobName string) []string
- func GetLogger(ctx context.Context) *slog.Logger
- func JobsFromConfig(c *config.Config) ([]Job, *Connecter, error)
- type ActiveSide
- func (j *ActiveSide) Cron() string
- 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) error
- func (j *ActiveSide) Runnable() bool
- func (j *ActiveSide) Running() (d time.Duration, ok bool)
- func (j *ActiveSide) SenderConfig() *endpoint.SenderConfig
- 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() (sleepUntil 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) Cron() string
- 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) error
- func (j *PassiveSide) Runnable() bool
- func (j *PassiveSide) SenderConfig() *endpoint.SenderConfig
- 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() (sleepUntil time.Time)
- func (self *PassiveStatus) Steps() (expected, step int)
- type ReceivingJobConfig
- type SenderOnce
- type SendingJobConfig
- type SnapJob
- func (j *SnapJob) Cron() string
- func (j *SnapJob) Name() string
- func (j *SnapJob) OwnedDatasetSubtreeRoot() (*zfs.DatasetPath, bool)
- func (j *SnapJob) RegisterMetrics(registerer prometheus.Registerer)
- func (j *SnapJob) Run(ctx context.Context) error
- func (j *SnapJob) Runnable() bool
- func (j *SnapJob) SenderConfig() *endpoint.SenderConfig
- 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) 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(b []byte) error
- type Type
Constants ¶
View Source
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) Cron ¶ added in v0.9.3
func (j *ActiveSide) Cron() string
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) Status ¶
func (j *ActiveSide) Status() *Status
type ActiveSideState ¶
type ActiveSideState int
const ( ActiveSideDone ActiveSideState = iota ActiveSideSnapshot ActiveSideReplicating ActiveSidePruneSender ActiveSidePruneReceiver )
func (ActiveSideState) String ¶
func (self ActiveSideState) String() string
type ActiveSideStatus ¶
type ActiveSideStatus struct { CronSpec string 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() (sleepUntil 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) error RegisterMetrics(registerer prometheus.Registerer) }
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 Cron() string }
type LocalSender ¶ added in v0.9.2
func NewLocalSender ¶ added in v0.9.2
func NewLocalSender(ctx context.Context, target *endpoint.Sender) *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) 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) Cron ¶ added in v0.9.3
func (j *PassiveSide) Cron() string
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) 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() (sleepUntil 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 SenderOnce ¶ added in v0.9.3
func NewSenderOnce ¶ added in v0.9.3
func NewSenderOnce(ctx context.Context, endpoint logic.Sender, ) *SenderOnce
func (*SenderOnce) ListFilesystems ¶ added in v0.9.3
func (self *SenderOnce) ListFilesystems(context.Context, ) (*pdu.ListFilesystemRes, error)
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() (*zfs.DatasetPath, 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)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.