Documentation ¶
Index ¶
- Constants
- Variables
- func Validator() *validator.Validate
- type ActiveJob
- type BandwidthLimit
- type Config
- type ConflictResolution
- type ConnectCommon
- type ConnectEnum
- type Duration
- type FileLoggingOutlet
- type FilesystemsFilter
- type Global
- type GlobalControl
- type GlobalServe
- type GlobalStdinServer
- type HookCommand
- type HookEnum
- type HookList
- type HookSettingsCommon
- type JobEnum
- 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"` }
type BandwidthLimit ¶ added in v0.7.4
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 ¶ added in v0.7.4
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 Duration ¶ added in v0.7.4
type Duration struct {
// contains filtered or unexported fields
}
func (*Duration) UnmarshalYAML ¶ added in v0.7.4
type FileLoggingOutlet ¶ added in v0.7.4
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 ¶ added in v0.7.4
type HookCommand struct { Path string `yaml:"path" validate:"required"` Timeout time.Duration `yaml:"timeout" default:"30s" validate:"gt=0s"` Filesystems FilesystemsFilter `yaml:"filesystems" validate:"min=1"` HookSettingsCommon `yaml:",inline"` }
type HookEnum ¶ added in v0.7.4
type HookEnum struct {
Ret any `validate:"required"`
}
func (*HookEnum) UnmarshalYAML ¶ added in v0.7.4
type HookSettingsCommon ¶ added in v0.7.4
type JobEnum ¶
type JobEnum struct {
Ret any `validate:"required"`
}
func (JobEnum) MonitorSnapshots ¶ added in v0.8.4
func (j JobEnum) MonitorSnapshots() MonitorSnapshots
func (*JobEnum) UnmarshalYAML ¶
type Listen ¶ added in v0.8.5
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 ¶ added in v0.7.8
func (l *LoggingOutletEnumList) SetDefaults()
type MonitorCount ¶ added in v0.8.4
type MonitorCreation ¶ added in v0.8.4
type MonitorSnapshots ¶ added in v0.7.4
type MonitorSnapshots struct { Count []MonitorCount `yaml:"count" validate:"dive"` Latest []MonitorCreation `yaml:"latest" validate:"dive"` Oldest []MonitorCreation `yaml:"oldest" validate:"dive"` }
func (*MonitorSnapshots) Valid ¶ added in v0.8.4
func (self *MonitorSnapshots) Valid() bool
type ParseFlags ¶ added in v0.7.4
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 ¶ added in v0.7.4
type PlaceholderRecvOptions struct {
Encryption string `yaml:"encryption" default:"inherit" validate:"required"`
}
type PositiveDuration ¶ added in v0.7.4
type PositiveDuration struct {
// contains filtered or unexported fields
}
func (PositiveDuration) Duration ¶ added in v0.7.4
func (d PositiveDuration) Duration() time.Duration
func (*PositiveDuration) UnmarshalYAML ¶ added in v0.7.4
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 ¶ added in v0.7.4
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 ¶ added in v0.7.4
func (*PullJob) GetRecvOptions ¶ added in v0.7.4
func (j *PullJob) GetRecvOptions() *RecvOptions
type PushJob ¶
type PushJob struct { ActiveJob `yaml:",inline"` Snapshotting SnapshottingEnum `yaml:"snapshotting"` Filesystems FilesystemsFilter `yaml:"filesystems" validate:"min=1"` Send SendOptions `yaml:"send"` }
func (*PushJob) GetFilesystems ¶ added in v0.7.4
func (j *PushJob) GetFilesystems() FilesystemsFilter
func (*PushJob) GetSendOptions ¶ added in v0.7.4
func (j *PushJob) GetSendOptions() *SendOptions
type RecvOptions ¶ added in v0.7.4
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 ¶ added in v0.7.4
type Replication struct { Protection ReplicationOptionsProtection `yaml:"protection"` Concurrency ReplicationOptionsConcurrency `yaml:"concurrency"` OneStep bool `yaml:"one_step" default:"true"` }
type ReplicationOptionsConcurrency ¶ added in v0.7.4
type ReplicationOptionsProtection ¶ added in v0.7.4
type RetentionInterval ¶
type RetentionInterval struct {
// contains filtered or unexported fields
}
func ParseRetentionIntervalSpec ¶ added in v0.7.4
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 ¶ added in v0.7.4
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 ServeEnum ¶
type ServeEnum struct {
Ret any `validate:"required"`
}
func (*ServeEnum) UnmarshalYAML ¶
type SinkJob ¶
type SinkJob struct { PassiveJob `yaml:",inline"` RootFS string `yaml:"root_fs" validate:"required"` Recv RecvOptions `yaml:"recv"` }
func (*SinkJob) GetAppendClientIdentity ¶ added in v0.7.4
func (*SinkJob) GetRecvOptions ¶ added in v0.7.4
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:"min=1"` 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 HookList `yaml:"hooks"` TimestampFormat string `yaml:"timestamp_format" default:"dense" validate:"required"` TimestampLocal bool `yaml:"timestamp_local" default:"true"` }
func (*SnapshottingPeriodic) CronSpec ¶ added in v0.7.4
func (self *SnapshottingPeriodic) CronSpec() string
type SourceJob ¶
type SourceJob struct { PassiveJob `yaml:",inline"` Snapshotting SnapshottingEnum `yaml:"snapshotting"` Filesystems FilesystemsFilter `yaml:"filesystems" validate:"min=1"` Send SendOptions `yaml:"send"` }
func (*SourceJob) GetFilesystems ¶ added in v0.7.4
func (j *SourceJob) GetFilesystems() FilesystemsFilter
func (*SourceJob) GetSendOptions ¶ added in v0.7.4
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 ¶ added in v0.7.8
func (f *SyslogFacility) SetDefaults()
func (*SyslogFacility) UnmarshalJSON ¶ added in v0.7.8
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.