Documentation
¶
Index ¶
- Constants
- Variables
- func Validator() *validator.Validate
- type ActiveJob
- type BandwidthLimit
- type Config
- type ConflictResolution
- type ConnectCommon
- type ConnectEnum
- type DatasetFilter
- type Duration
- type FileLoggingOutlet
- type FilesystemsFilter
- type Global
- type GlobalControl
- type GlobalServe
- type GlobalStdinServer
- type HookCommand
- type JobEnum
- type JobHooks
- type Listen
- type LocalConnect
- type LocalServe
- type LoggingOutletCommon
- type LoggingOutletEnum
- type LoggingOutletEnumList
- type MonitorCount
- type MonitorCreation
- type MonitorSnapshots
- type ParseFlags
- type PassiveJob
- type PlaceholderRecvOptions
- type PositiveDuration
- type PositiveDurationOrManual
- type PrometheusMonitoring
- type PropertyRecvOptions
- type PruneGrid
- type PruneKeepLastN
- type PruneKeepNotReplicated
- type PruneKeepRegex
- type PruningEnum
- type PruningLocal
- type PruningSenderReceiver
- type PullJob
- type PushJob
- type RecvOptions
- type Replication
- type ReplicationOptionsConcurrency
- type ReplicationOptionsProtection
- type RetentionInterval
- type RetentionIntervalList
- type SSHStdinserverConnect
- type SendOptions
- type ServeCommon
- type ServeEnum
- type SinkJob
- type SnapJob
- type SnapshottingEnum
- type SnapshottingManual
- type SnapshottingPeriodic
- type SourceJob
- type StdinserverServer
- type SyslogFacility
- type SyslogLoggingOutlet
- type TCPConnect
- type TCPLoggingOutlet
- type TCPLoggingOutletTLS
- type TCPServe
- type TLSConnect
- type TLSServe
Constants ¶
View Source
const RetentionGridKeepCountAll int = -1
Variables ¶
View Source
var ConfigFileDefaultLocations = []string{
"/etc/zrepl/zrepl.yml",
"/usr/local/etc/zrepl/zrepl.yml",
}
Functions ¶
Types ¶
type ActiveJob ¶
type ActiveJob struct {
Type string `yaml:"type" validate:"required"`
Name string `yaml:"name" validate:"required"`
Connect ConnectEnum `yaml:"connect"`
Pruning PruningSenderReceiver `yaml:"pruning" validate:"required"`
Replication Replication `yaml:"replication"`
ConflictResolution ConflictResolution `yaml:"conflict_resolution"`
MonitorSnapshots MonitorSnapshots `yaml:"monitor"`
Interval PositiveDurationOrManual `yaml:"interval"`
Cron string `yaml:"cron"`
Hooks JobHooks `yaml:"hooks"`
}
type BandwidthLimit ¶
type BandwidthLimit struct {
Max datasizeunit.Bits `yaml:"max" default:"-1 B" validate:"required"`
BucketCapacity datasizeunit.Bits `yaml:"bucket_capacity" default:"128 KiB" validate:"required"`
}
type Config ¶
type Config struct {
Jobs []JobEnum `yaml:"jobs" validate:"min=1,dive"`
Global Global `yaml:"global"`
Listen []Listen `yaml:"listen" validate:"dive"`
}
func ParseConfig ¶
func ParseConfigBytes ¶
type ConflictResolution ¶
type ConflictResolution struct {
InitialReplication string `yaml:"initial_replication" default:"all" validate:"required"`
}
type ConnectCommon ¶
type ConnectCommon struct {
Type string `yaml:"type" validate:"required"`
}
type ConnectEnum ¶
type ConnectEnum struct {
Ret any `validate:"required"`
}
func (*ConnectEnum) UnmarshalYAML ¶
func (t *ConnectEnum) UnmarshalYAML(value *yaml.Node) (err error)
type DatasetFilter ¶ added in v0.8.10
type FileLoggingOutlet ¶
type FileLoggingOutlet struct {
LoggingOutletCommon `yaml:",inline"`
FileName string `yaml:"filename"`
}
type FilesystemsFilter ¶
type Global ¶
type Global struct {
RpcTimeout time.Duration `yaml:"rpc_timeout" default:"1m" validate:"gt=0s"`
ZfsBin string `yaml:"zfs_bin" default:"zfs" validate:"required"`
Logging LoggingOutletEnumList `yaml:"logging" validate:"min=1"`
Monitoring []PrometheusMonitoring `yaml:"monitoring" validate:"dive"`
Control GlobalControl `yaml:"control"`
Serve GlobalServe `yaml:"serve"`
}
type GlobalControl ¶
type GlobalServe ¶
type GlobalServe struct {
StdinServer *GlobalStdinServer `yaml:"stdinserver" default:"{}" validate:"required"`
}
type GlobalStdinServer ¶
type GlobalStdinServer struct {
SockDir string `yaml:"sockdir" default:"/var/run/zrepl/stdinserver" validate:"required"`
}
type HookCommand ¶
type HookCommand struct {
Path string `yaml:"path" validate:"required"`
Args []string `yaml:"args" validate:"dive,required"`
Env map[string]string `yaml:"env" validate:"dive,keys,required,endkeys,required"`
Timeout time.Duration `yaml:"timeout" default:"30s" validate:"min=0s"`
Filesystems FilesystemsFilter `yaml:"filesystems"`
Datasets []DatasetFilter `yaml:"datasets" validate:"dive"`
ErrIsFatal bool `yaml:"err_is_fatal"`
}
func (*HookCommand) UnmarshalYAML ¶ added in v0.8.10
func (self *HookCommand) UnmarshalYAML(value *yaml.Node) error
type JobEnum ¶
type JobEnum struct {
Ret any `validate:"required"`
}
func (JobEnum) MonitorSnapshots ¶
func (j JobEnum) MonitorSnapshots() MonitorSnapshots
type JobHooks ¶ added in v0.8.10
type JobHooks struct {
Pre *HookCommand `yaml:"pre"`
Post *HookCommand `yaml:"post"`
}
type Listen ¶
type Listen struct {
Addr string `yaml:"addr" validate:"required_without=Unix,omitempty,hostname_port"`
Unix string `yaml:"unix" validate:"required_without=Addr,omitempty,filepath"`
UnixMode uint32 `yaml:"unix_mode" validate:"lte=0o777"`
TLSCert string `yaml:"tls_cert" validate:"required_with=TLSKey,omitempty,filepath"`
TLSKey string `yaml:"tls_key" validate:"omitempty,filepath"`
Control bool `yaml:"control" validate:"required_without=Metrics"`
Metrics bool `yaml:"metrics" validate:"required_without=Control"`
}
type LocalConnect ¶
type LocalConnect struct {
ConnectCommon `yaml:",inline"`
ListenerName string `yaml:"listener_name" validate:"required"`
ClientIdentity string `yaml:"client_identity" validate:"required"`
DialTimeout time.Duration `yaml:"dial_timeout" default:"2s" validate:"min=0s"`
}
type LocalServe ¶
type LocalServe struct {
ServeCommon `yaml:",inline"`
ListenerName string `yaml:"listener_name" validate:"required"`
}
type LoggingOutletCommon ¶
type LoggingOutletEnum ¶
type LoggingOutletEnum struct {
Ret any `validate:"required"`
}
func (*LoggingOutletEnum) UnmarshalYAML ¶
func (t *LoggingOutletEnum) UnmarshalYAML(value *yaml.Node) (err error)
type LoggingOutletEnumList ¶
type LoggingOutletEnumList []LoggingOutletEnum
func (*LoggingOutletEnumList) SetDefaults ¶
func (l *LoggingOutletEnumList) SetDefaults()
type MonitorCount ¶
type MonitorCreation ¶
type MonitorSnapshots ¶
type MonitorSnapshots struct {
Count []MonitorCount `yaml:"count" validate:"dive"`
Latest []MonitorCreation `yaml:"latest" validate:"dive"`
Oldest []MonitorCreation `yaml:"oldest" validate:"dive"`
}
func (*MonitorSnapshots) Valid ¶
func (self *MonitorSnapshots) Valid() bool
type ParseFlags ¶
type ParseFlags uint
const ( ParseFlagsNone ParseFlags = 0 ParseFlagsNoCertCheck ParseFlags = 1 << iota )
type PassiveJob ¶
type PassiveJob struct {
Type string `yaml:"type" validate:"required"`
Name string `yaml:"name" validate:"required"`
Serve ServeEnum `yaml:"serve"`
MonitorSnapshots MonitorSnapshots `yaml:"monitor"`
}
type PlaceholderRecvOptions ¶
type PlaceholderRecvOptions struct {
Encryption string `yaml:"encryption" default:"inherit" validate:"required"`
}
type PositiveDuration ¶
type PositiveDuration struct {
// contains filtered or unexported fields
}
func (PositiveDuration) Duration ¶
func (d PositiveDuration) Duration() time.Duration
func (*PositiveDuration) UnmarshalYAML ¶
func (d *PositiveDuration) UnmarshalYAML(value *yaml.Node) error
type PositiveDurationOrManual ¶
func (*PositiveDurationOrManual) UnmarshalYAML ¶
func (i *PositiveDurationOrManual) UnmarshalYAML(value *yaml.Node) (err error)
type PrometheusMonitoring ¶
type PropertyRecvOptions ¶
type PruneGrid ¶
type PruneGrid struct {
Type string `yaml:"type"`
Grid RetentionIntervalList `yaml:"grid"`
Regex string `yaml:"regex"`
}
type PruneKeepLastN ¶
type PruneKeepNotReplicated ¶
type PruneKeepRegex ¶
type PruningEnum ¶
type PruningEnum struct {
Ret any `validate:"required"`
}
func (*PruningEnum) UnmarshalYAML ¶
func (t *PruningEnum) UnmarshalYAML(value *yaml.Node) (err error)
type PruningLocal ¶
type PruningLocal struct {
Keep []PruningEnum `yaml:"keep"`
}
type PruningSenderReceiver ¶
type PruningSenderReceiver struct {
KeepSender []PruningEnum `yaml:"keep_sender"`
KeepReceiver []PruningEnum `yaml:"keep_receiver"`
}
type PullJob ¶
type PullJob struct {
ActiveJob `yaml:",inline"`
RootFS string `yaml:"root_fs" validate:"required"`
Recv RecvOptions `yaml:"recv"`
}
func (*PullJob) GetAppendClientIdentity ¶
func (*PullJob) GetRecvOptions ¶
func (j *PullJob) GetRecvOptions() *RecvOptions
type PushJob ¶
type PushJob struct {
ActiveJob `yaml:",inline"`
Snapshotting SnapshottingEnum `yaml:"snapshotting"`
Filesystems FilesystemsFilter `yaml:"filesystems" validate:"required_without=Datasets"`
Datasets []DatasetFilter `yaml:"datasets" validate:"required_without=Filesystems,dive"`
Send SendOptions `yaml:"send"`
}
func (*PushJob) GetFilesystems ¶
func (j *PushJob) GetFilesystems() (FilesystemsFilter, []DatasetFilter)
func (*PushJob) GetSendOptions ¶
func (j *PushJob) GetSendOptions() *SendOptions
type RecvOptions ¶
type RecvOptions struct {
Properties PropertyRecvOptions `yaml:"properties"`
BandwidthLimit BandwidthLimit `yaml:"bandwidth_limit"`
Placeholder PlaceholderRecvOptions `yaml:"placeholder"`
ExecPipe [][]string `yaml:"execpipe" validate:"dive,required"`
}
type Replication ¶
type Replication struct {
Protection ReplicationOptionsProtection `yaml:"protection"`
Concurrency ReplicationOptionsConcurrency `yaml:"concurrency"`
OneStep bool `yaml:"one_step" default:"true"`
}
type RetentionInterval ¶
type RetentionInterval struct {
// contains filtered or unexported fields
}
func ParseRetentionIntervalSpec ¶
func ParseRetentionIntervalSpec(s string) (intervals []RetentionInterval, err error)
func (*RetentionInterval) KeepCount ¶
func (i *RetentionInterval) KeepCount() int
func (*RetentionInterval) Length ¶
func (i *RetentionInterval) Length() time.Duration
type RetentionIntervalList ¶
type RetentionIntervalList []RetentionInterval
func (*RetentionIntervalList) UnmarshalYAML ¶
func (t *RetentionIntervalList) UnmarshalYAML(value *yaml.Node) (err error)
type SSHStdinserverConnect ¶
type SSHStdinserverConnect struct {
ConnectCommon `yaml:",inline"`
Host string `yaml:"host" validate:"required"`
User string `yaml:"user" validate:"required"`
Port uint16 `yaml:"port" validate:"required"`
IdentityFile string `yaml:"identity_file" validate:"required"`
TransportOpenCommand []string `yaml:"transport_open_command"` // TODO unused
SSHCommand string `yaml:"ssh_command"` // TODO unused
Options []string `yaml:"options" validate:"dive,required"`
DialTimeout time.Duration `yaml:"dial_timeout" default:"10s" validate:"min=0s"`
}
type SendOptions ¶
type SendOptions struct {
Encrypted bool `yaml:"encrypted"`
Raw bool `yaml:"raw" default:"true"`
SendProperties bool `yaml:"send_properties"`
BackupProperties bool `yaml:"backup_properties"`
LargeBlocks bool `yaml:"large_blocks"`
Compressed bool `yaml:"compressed"`
EmbeddedData bool `yaml:"embedded_data"`
Saved bool `yaml:"saved"`
BandwidthLimit BandwidthLimit `yaml:"bandwidth_limit"`
ExecPipe [][]string `yaml:"execpipe" validate:"dive,required"`
}
type ServeCommon ¶
type ServeCommon struct {
Type string `yaml:"type" validate:"required"`
}
type SinkJob ¶
type SinkJob struct {
PassiveJob `yaml:",inline"`
RootFS string `yaml:"root_fs" validate:"required"`
Recv RecvOptions `yaml:"recv"`
}
func (*SinkJob) GetAppendClientIdentity ¶
func (*SinkJob) GetRecvOptions ¶
func (j *SinkJob) GetRecvOptions() *RecvOptions
type SnapJob ¶
type SnapJob struct {
Type string `yaml:"type" validate:"required"`
Name string `yaml:"name" validate:"required"`
Pruning PruningLocal `yaml:"pruning"`
Snapshotting SnapshottingEnum `yaml:"snapshotting"`
Filesystems FilesystemsFilter `yaml:"filesystems" validate:"required_without=Datasets"`
Datasets []DatasetFilter `yaml:"datasets" validate:"required_without=Filesystems,dive"`
MonitorSnapshots MonitorSnapshots `yaml:"monitor"`
}
type SnapshottingEnum ¶
type SnapshottingEnum struct {
Ret any `validate:"required"`
}
func (*SnapshottingEnum) UnmarshalYAML ¶
func (t *SnapshottingEnum) UnmarshalYAML(value *yaml.Node) (err error)
type SnapshottingManual ¶
type SnapshottingManual struct {
Type string `yaml:"type" validate:"required"`
}
type SnapshottingPeriodic ¶
type SnapshottingPeriodic struct {
Type string `yaml:"type" validate:"required"`
Prefix string `yaml:"prefix" validate:"required"`
Interval Duration `yaml:"interval"`
Cron string `yaml:"cron"`
Hooks []HookCommand `yaml:"hooks" validate:"dive"`
TimestampFormat string `yaml:"timestamp_format" default:"dense" validate:"required"`
TimestampLocal bool `yaml:"timestamp_local" default:"true"`
}
func (*SnapshottingPeriodic) CronSpec ¶
func (self *SnapshottingPeriodic) CronSpec() string
type SourceJob ¶
type SourceJob struct {
PassiveJob `yaml:",inline"`
Snapshotting SnapshottingEnum `yaml:"snapshotting"`
Filesystems FilesystemsFilter `yaml:"filesystems" validate:"required_without=Datasets"`
Datasets []DatasetFilter `yaml:"datasets" validate:"required_without=Filesystems,dive"`
Send SendOptions `yaml:"send"`
}
func (*SourceJob) GetFilesystems ¶
func (j *SourceJob) GetFilesystems() (FilesystemsFilter, []DatasetFilter)
func (*SourceJob) GetSendOptions ¶
func (j *SourceJob) GetSendOptions() *SendOptions
type StdinserverServer ¶
type StdinserverServer struct {
ServeCommon `yaml:",inline"`
ClientIdentities []string `yaml:"client_identities" validate:"dive,required"`
}
type SyslogFacility ¶
func (*SyslogFacility) SetDefaults ¶
func (f *SyslogFacility) SetDefaults()
func (*SyslogFacility) UnmarshalJSON ¶
func (f *SyslogFacility) UnmarshalJSON(b []byte) error
func (*SyslogFacility) UnmarshalYAML ¶
func (t *SyslogFacility) UnmarshalYAML(value *yaml.Node) (err error)
type SyslogLoggingOutlet ¶
type SyslogLoggingOutlet struct {
LoggingOutletCommon `yaml:",inline"`
Facility SyslogFacility `yaml:"facility" default:"local0" validate:"required"`
RetryInterval time.Duration `yaml:"retry_interval" default:"10s" validate:"gt=0s"`
}
type TCPConnect ¶
type TCPConnect struct {
ConnectCommon `yaml:",inline"`
Address string `yaml:"address" validate:"required,hostname_port"`
DialTimeout time.Duration `yaml:"dial_timeout" default:"10s" validate:"min=0s"`
}
type TCPLoggingOutlet ¶
type TCPLoggingOutlet struct {
LoggingOutletCommon `yaml:",inline"`
Address string `yaml:"address" validate:"required,hostname_port"`
Net string `yaml:"net" default:"tcp" validate:"required"`
RetryInterval time.Duration `yaml:"retry_interval" default:"10s" validate:"gt=0s"`
TLS *TCPLoggingOutletTLS `yaml:"tls"`
}
type TCPLoggingOutletTLS ¶
type TCPServe ¶
type TCPServe struct {
ServeCommon `yaml:",inline"`
Listen string `yaml:"listen" validate:"required,hostname_port"`
ListenFreeBind bool `yaml:"listen_freebind"`
Clients map[string]string `yaml:"clients" validate:"dive,required"`
}
type TLSConnect ¶
type TLSConnect struct {
ConnectCommon `yaml:",inline"`
Address string `yaml:"address" validate:"required,hostname_port"`
Ca string `yaml:"ca" validate:"required"`
Cert string `yaml:"cert" validate:"required"`
Key string `yaml:"key" validate:"required"`
ServerCN string `yaml:"server_cn" validate:"required"`
DialTimeout time.Duration `yaml:"dial_timeout" default:"10s" validate:"min=0s"`
}
type TLSServe ¶
type TLSServe struct {
ServeCommon `yaml:",inline"`
Listen string `yaml:"listen" validate:"required,hostname_port"`
ListenFreeBind bool `yaml:"listen_freebind"`
Ca string `yaml:"ca" validate:"required"`
Cert string `yaml:"cert" validate:"required"`
Key string `yaml:"key" validate:"required"`
ClientCNs []string `yaml:"client_cns" validate:"dive,required"`
HandshakeTimeout time.Duration `yaml:"handshake_timeout" default:"10s" validate:"min=0s"`
}
Click to show internal directories.
Click to hide internal directories.