Documentation ¶
Index ¶
- Constants
- Variables
- func Pattern(glob string) string
- func ValidateEffectiveUnix(effective time.Time) int64
- type Archive
- type ArchiveFilter
- type DB
- func (db *DB) Alias(name string, sql string) error
- func (db *DB) AnnotateArchive(id uuid.UUID, notes string) error
- func (db *DB) AnnotateJob(id uuid.UUID, name string, summary string) error
- func (db *DB) AnnotateRetentionPolicy(id uuid.UUID, name string, summary string) error
- func (db *DB) AnnotateSchedule(id uuid.UUID, name string, summary string) error
- func (db *DB) AnnotateStore(id uuid.UUID, name string, summary string) error
- func (db *DB) AnnotateTarget(id uuid.UUID, name string, summary string) error
- func (db *DB) CancelTask(id uuid.UUID, effective time.Time) error
- func (db *DB) CheckCurrentSchema() error
- func (db *DB) CompleteTask(id uuid.UUID, effective time.Time) error
- func (db *DB) Connect() error
- func (db *DB) Connected() bool
- func (db *DB) Copy() *DB
- func (db *DB) Count(sql_or_name string, args ...interface{}) (uint, error)
- func (db *DB) CreateBackupTask(owner string, job *Job) (*Task, error)
- func (db *DB) CreateJob(target, store, schedule, retention string, paused bool) (uuid.UUID, error)
- func (db *DB) CreatePurgeTask(owner string, archive *Archive, agent string) (*Task, error)
- func (db *DB) CreateRestoreTask(owner string, archive *Archive, target *Target) (*Task, error)
- func (db *DB) CreateRetentionPolicy(expiry uint) (uuid.UUID, error)
- func (db *DB) CreateSchedule(ts string) (uuid.UUID, error)
- func (db *DB) CreateStore(plugin string, endpoint interface{}) (uuid.UUID, error)
- func (db *DB) CreateTarget(plugin string, endpoint interface{}, agent string) (uuid.UUID, error)
- func (db *DB) CreateTaskArchive(id uuid.UUID, key string, effective time.Time) (uuid.UUID, error)
- func (db *DB) DeleteArchive(id uuid.UUID) (bool, error)
- func (db *DB) DeleteJob(id uuid.UUID) (bool, error)
- func (db *DB) DeleteRetentionPolicy(id uuid.UUID) (bool, error)
- func (db *DB) DeleteSchedule(id uuid.UUID) (bool, error)
- func (db *DB) DeleteStore(id uuid.UUID) (bool, error)
- func (db *DB) DeleteTarget(id uuid.UUID) (bool, error)
- func (db *DB) Disconnect() error
- func (db *DB) Exec(sql_or_name string, args ...interface{}) error
- func (db *DB) ExpireArchive(id uuid.UUID) error
- func (db *DB) FailTask(id uuid.UUID, effective time.Time) error
- func (db *DB) GetAllArchives(filter *ArchiveFilter) ([]*Archive, error)
- func (db *DB) GetAllJobs(filter *JobFilter) ([]*Job, error)
- func (db *DB) GetAllRetentionPolicies(filter *RetentionFilter) ([]*RetentionPolicy, error)
- func (db *DB) GetAllSchedules(filter *ScheduleFilter) ([]*Schedule, error)
- func (db *DB) GetAllStores(filter *StoreFilter) ([]*Store, error)
- func (db *DB) GetAllTargets(filter *TargetFilter) ([]*Target, error)
- func (db *DB) GetAllTasks(filter *TaskFilter) ([]*Task, error)
- func (db *DB) GetArchive(id uuid.UUID) (*Archive, error)
- func (db *DB) GetArchivesNeedingPurge() ([]*Archive, error)
- func (db *DB) GetExpiredArchives() ([]*Archive, error)
- func (db *DB) GetJob(id uuid.UUID) (*Job, error)
- func (db *DB) GetRestoreTaskDetails(archive, target uuid.UUID, ...) error
- func (db *DB) GetRetentionPolicy(id uuid.UUID) (*RetentionPolicy, error)
- func (db *DB) GetSchedule(id uuid.UUID) (*Schedule, error)
- func (db *DB) GetStore(id uuid.UUID) (*Store, error)
- func (db *DB) GetTarget(id uuid.UUID) (*Target, error)
- func (db *DB) GetTask(id uuid.UUID) (*Task, error)
- func (db *DB) InvalidateArchive(id uuid.UUID) error
- func (db *DB) IsTaskRunnable(task *Task) (bool, error)
- func (db *DB) PauseJob(id uuid.UUID) (bool, error)
- func (db *DB) PauseOrUnpauseJob(id uuid.UUID, pause bool) (bool, error)
- func (db *DB) PurgeArchive(id uuid.UUID) error
- func (db *DB) Query(sql_or_name string, args ...interface{}) (*sql.Rows, error)
- func (db *DB) SchemaVersion() (int, error)
- func (db *DB) Setup() error
- func (db *DB) StartTask(id uuid.UUID, effective time.Time) error
- func (db *DB) UnpauseJob(id uuid.UUID) (bool, error)
- func (db *DB) UpdateJob(id uuid.UUID, target, store, schedule, retention string) error
- func (db *DB) UpdateRetentionPolicy(id uuid.UUID, expiry uint) error
- func (db *DB) UpdateSchedule(id uuid.UUID, ts string) error
- func (db *DB) UpdateStore(id uuid.UUID, plugin string, endpoint interface{}) error
- func (db *DB) UpdateTarget(id uuid.UUID, plugin string, endpoint interface{}, agent string) error
- func (db *DB) UpdateTaskLog(id uuid.UUID, more string) error
- type Job
- type JobFilter
- type NullUUID
- type RetentionFilter
- type RetentionPolicy
- type Schedule
- type ScheduleFilter
- type Schema
- type Store
- type StoreFilter
- type Target
- type TargetFilter
- type Task
- type TaskFilter
- type TaskInfo
Constants ¶
View Source
const ( BackupOperation = "backup" RestoreOperation = "restore" PurgeOperation = "purge" PendingStatus = "pending" RunningStatus = "running" CanceledStatus = "canceled" FailedStatus = "failed" DoneStatus = "done" )
Variables ¶
View Source
var CurrentSchema int = currentSchema()
View Source
var Schemas = map[int]Schema{
1: v1Schema{},
2: v2Schema{},
3: v3Schema{},
}
Functions ¶
func ValidateEffectiveUnix ¶ added in v0.4.1
Types ¶
type Archive ¶ added in v0.6.4
type Archive struct { UUID uuid.UUID `json:"uuid"` StoreKey string `json:"key"` TakenAt Timestamp `json:"taken_at"` ExpiresAt Timestamp `json:"expires_at"` Notes string `json:"notes"` Status string `json:"status"` PurgeReason string `json:"purge_reason"` TargetUUID uuid.UUID `json:"target_uuid"` TargetName string `json:"target_name"` TargetPlugin string `json:"target_plugin"` TargetEndpoint string `json:"target_endpoint"` StoreUUID uuid.UUID `json:"store_uuid"` StoreName string `json:"store_name"` StorePlugin string `json:"store_plugin"` StoreEndpoint string `json:"store_endpoint"` }
type ArchiveFilter ¶
type ArchiveFilter struct { ForTarget string ForStore string Before *time.Time After *time.Time ExpiresBefore *time.Time WithStatus []string WithOutStatus []string Limit string }
func (*ArchiveFilter) Query ¶
func (f *ArchiveFilter) Query() (string, []interface{})
type DB ¶
func (*DB) AnnotateRetentionPolicy ¶
func (*DB) AnnotateSchedule ¶
func (*DB) AnnotateStore ¶
func (*DB) AnnotateTarget ¶
func (*DB) CheckCurrentSchema ¶
func (*DB) CreatePurgeTask ¶
func (*DB) CreateRestoreTask ¶
func (*DB) CreateRetentionPolicy ¶
func (*DB) CreateStore ¶
func (*DB) CreateTarget ¶
func (*DB) CreateTaskArchive ¶
func (*DB) GetAllArchives ¶ added in v0.6.4
func (db *DB) GetAllArchives(filter *ArchiveFilter) ([]*Archive, error)
func (*DB) GetAllRetentionPolicies ¶ added in v0.6.4
func (db *DB) GetAllRetentionPolicies(filter *RetentionFilter) ([]*RetentionPolicy, error)
func (*DB) GetAllSchedules ¶ added in v0.6.4
func (db *DB) GetAllSchedules(filter *ScheduleFilter) ([]*Schedule, error)
func (*DB) GetAllStores ¶ added in v0.6.4
func (db *DB) GetAllStores(filter *StoreFilter) ([]*Store, error)
func (*DB) GetAllTargets ¶ added in v0.6.4
func (db *DB) GetAllTargets(filter *TargetFilter) ([]*Target, error)
func (*DB) GetAllTasks ¶ added in v0.6.4
func (db *DB) GetAllTasks(filter *TaskFilter) ([]*Task, error)
func (*DB) GetArchivesNeedingPurge ¶
func (*DB) GetExpiredArchives ¶
func (*DB) GetRestoreTaskDetails ¶
func (*DB) GetRetentionPolicy ¶ added in v0.6.4
func (db *DB) GetRetentionPolicy(id uuid.UUID) (*RetentionPolicy, error)
func (*DB) PauseOrUnpauseJob ¶
func (*DB) SchemaVersion ¶
func (*DB) UpdateRetentionPolicy ¶
func (*DB) UpdateStore ¶
func (*DB) UpdateTarget ¶
type Job ¶ added in v0.6.4
type Job struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Summary string `json:"summary"` RetentionName string `json:"retention_name"` RetentionUUID uuid.UUID `json:"retention_uuid"` Expiry int `json:"expiry"` ScheduleName string `json:"schedule_name"` ScheduleUUID uuid.UUID `json:"schedule_uuid"` ScheduleWhen string `json:"schedule_when"` Paused bool `json:"paused"` StoreUUID uuid.UUID `json:"store_uuid"` StoreName string `json:"store_name"` StorePlugin string `json:"store_plugin"` StoreEndpoint string `json:"store_endpoint"` TargetUUID uuid.UUID `json:"target_uuid"` TargetName string `json:"target_name"` TargetPlugin string `json:"target_plugin"` TargetEndpoint string `json:"target_endpoint"` Agent string `json:"agent"` LastRun Timestamp `json:"last_run"` LastTaskStatus string `json:"last_task_status"` Spec *timespec.Spec `json:"-"` NextRun time.Time `json:"-"` }
func (*Job) Reschedule ¶ added in v0.6.4
type JobFilter ¶
type RetentionFilter ¶
func (*RetentionFilter) Query ¶
func (f *RetentionFilter) Query() (string, []interface{})
type RetentionPolicy ¶ added in v0.6.4
type ScheduleFilter ¶
func (*ScheduleFilter) Query ¶
func (f *ScheduleFilter) Query() (string, []interface{})
type StoreFilter ¶
type StoreFilter struct { SkipUsed bool SkipUnused bool SearchName string ForPlugin string ExactMatch bool }
func (*StoreFilter) Query ¶
func (f *StoreFilter) Query() (string, []interface{})
type TargetFilter ¶
type TargetFilter struct { SkipUsed bool SkipUnused bool SearchName string ForPlugin string ExactMatch bool }
func (*TargetFilter) Query ¶
func (f *TargetFilter) Query() (string, []interface{})
type Task ¶ added in v0.6.4
type Task struct { UUID uuid.UUID `json:"uuid"` Owner string `json:"owner"` Op string `json:"type"` JobUUID uuid.UUID `json:"job_uuid"` ArchiveUUID uuid.UUID `json:"archive_uuid"` StoreUUID uuid.UUID `json:"-"` StorePlugin string `json:"-"` StoreEndpoint string `json:"-"` TargetUUID uuid.UUID `json:"-"` TargetPlugin string `json:"-"` TargetEndpoint string `json:"-"` Status string `json:"status"` StartedAt Timestamp `json:"started_at"` StoppedAt Timestamp `json:"stopped_at"` TimeoutAt Timestamp `json:"-"` Attempts int `json:"-"` RestoreKey string `json:"-"` Agent string `json:"-"` Log string `json:"log"` TaskUUIDChan chan *TaskInfo `json:"-"` }
Click to show internal directories.
Click to hide internal directories.