Documentation ¶
Index ¶
Constants ¶
View Source
const Version = "v1alpha1"
Version is the latest version of the config format.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct { // Name is the name of the backup. Must be unique. Name string `json:"name"` // Commands is a list of commands to execute in order. Commands []Command `json:"commands"` // Requires is an optional list of requirements. Requires []Requirement `json:"requires,omitempty"` // Interval is the time interval between backups. Interval Duration `json:"interval"` }
Backup is the configuration for a backup.
type Command ¶
type Command struct { // Cmd is the full path to the command to run. Cmd string `json:"cmd"` // Args is the list of arguments to pass Args []string `json:"args"` // Env is a map of environment variables with their value. Env map[string]string `json:"env,omitempty"` // Workdir specifies the working directory. // Defaults to the current directory. Workdir string `json:"workdir,omitempty"` // SecretEnv is a map from environment variables to identifiers, not // stored in the config, but asked to the user at runtime. // If the same identifier is used by multiple variables within a backup, // the value will be asked only once and the value used multiple times. SecretEnv map[string]Secret `json:"secretEnv,omitempty"` }
Command represents a command to run.
type Duration ¶
Duration is a wrapper arond duration.
See https://github.com/golang/go/issues/10275 and https://stackoverflow.com/q/48050945/1667955.
func (Duration) MarshalJSON ¶
MarshalJSON provides custom JSON marshalling for Duration.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON provides custom JSON unmarshalling for Duration.
type Requirement ¶
type Requirement struct { // Path is a path in the filesystem that must be present in order for the // backup to proceed. Path *string `json:"path,omitempty"` }
Requirement is a backup requirement.
type Secret ¶
type Secret struct {
ID string `json:"id"`
}
Secret represents a secret value, not stored in the config but identified with a unique string and asked at runtime.
Click to show internal directories.
Click to hide internal directories.