Documentation
¶
Index ¶
- Constants
- func Validator() *validator.Validate
- type ActiveJob
- type AuthKey
- type Config
- type ConflictResolution
- type Connect
- type DatasetFilter
- type Duration
- type FileLoggingOutlet
- type FilesystemsFilter
- type Global
- type GlobalControl
- type HookCommand
- type JobEnum
- type JobHooks
- type Listen
- type LoggingOutletCommon
- type LoggingOutletEnum
- type LoggingOutletEnumList
- type MonitorCount
- type MonitorCreation
- type MonitorSnapshots
- type Option
- 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 SendOptions
- type SinkJob
- type SnapJob
- type SnapshottingEnum
- type SnapshottingManual
- type SnapshottingPeriodic
- type SourceJob
- type SyslogFacility
- type SyslogLoggingOutlet
- type TCPLoggingOutlet
- type TCPLoggingOutletTLS
Constants ¶
View Source
const RetentionGridKeepCountAll int = -1
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ActiveJob ¶
type ActiveJob struct {
Type string `yaml:"type" validate:"required"`
Name string `yaml:"name" validate:"required"`
Connect Connect `yaml:"connect"`
Pruning PruningSenderReceiver `yaml:"pruning"`
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 Config ¶
type Config struct {
Global Global `yaml:"global"`
Listen []Listen `yaml:"listen" validate:"dive"`
Keys []AuthKey `yaml:"keys" validate:"dive"`
IncludeKeys string `yaml:"include_keys" validate:"omitempty,filepath"`
Jobs []JobEnum `yaml:"jobs" validate:"min=1,dive"`
IncludeJobs string `yaml:"include_jobs" validate:"omitempty,filepath"`
// contains filtered or unexported fields
}
func ParseConfigBytes ¶
type ConflictResolution ¶
type ConflictResolution struct {
InitialReplication string `yaml:"initial_replication" default:"all" validate:"required"`
}
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"`
}
type GlobalControl ¶
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:"1m" 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_all=Metrics Zfs"`
Metrics bool `yaml:"metrics" validate:"required_without_all=Control Zfs"`
Zfs bool `yaml:"zfs" validate:"required_without_all=Control Metrics"`
}
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 MonitorCount struct {
Prefix string `yaml:"prefix"`
SkipDatasets []DatasetFilter `yaml:"skip_datasets" validate:"dive"`
Warning uint `yaml:"warning"`
Critical uint `yaml:"critical" validate:"required"`
}
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 Option ¶ added in v0.9.0
type Option func(self *Config)
func WithoutIncludes ¶ added in v0.9.3
func WithoutIncludes() Option
type PassiveJob ¶
type PassiveJob struct {
Type string `yaml:"type" validate:"required"`
Name string `yaml:"name" validate:"required"`
ClientKeys []string `yaml:"client_keys" validate:"dive,required"`
Pruning PruningLocal `yaml:"pruning"`
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) Duration ¶ added in v1.1.0
func (self *PositiveDurationOrManual) Duration() time.Duration
func (*PositiveDurationOrManual) UnmarshalYAML ¶
func (self *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 {
Concurrency uint `yaml:"concurrency"`
Keep []PruningEnum `yaml:"keep"`
}
type PruningSenderReceiver ¶
type PruningSenderReceiver struct {
Concurrency uint `yaml:"concurrency"`
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"`
Placeholder PlaceholderRecvOptions `yaml:"placeholder"`
ExecPipe [][]string `yaml:"execpipe" validate:"dive,required"`
}
type Replication ¶
type Replication struct {
Protection ReplicationOptionsProtection `yaml:"protection"`
Concurrency ReplicationOptionsConcurrency `yaml:"concurrency"`
Prefix string `yaml:"prefix"`
}
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 SendOptions ¶
type SendOptions struct {
ListPlaceholders bool `yaml:"list_placeholders"`
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"`
ExecPipe [][]string `yaml:"execpipe" validate:"dive,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,oneof=cron manual periodic"`
Prefix string `yaml:"prefix" validate:"required"`
Interval PositiveDurationOrManual `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"`
Concurrency uint `yaml:"concurrency"`
WrittenThreshold uint64 `yaml:"written_threshold"`
}
func (*SnapshottingPeriodic) CronSpec ¶
func (self *SnapshottingPeriodic) CronSpec() string
type SourceJob ¶
type SourceJob struct {
PassiveJob `yaml:",inline"`
Replication Replication `yaml:"replication"`
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 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 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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.