repository

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCron

func ValidateCron(fl validator.FieldLevel) bool

func ValidateId

func ValidateId(fl validator.FieldLevel) bool

func ValidatePathAbs

func ValidatePathAbs(fl validator.FieldLevel) bool

Types

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func NewRepo

func NewRepo(cfg RepoConfig, wg *sync.WaitGroup) (*Repo, error)

func (Repo) GetCronSpec

func (m Repo) GetCronSpec() string

func (Repo) PreReqs

func (m Repo) PreReqs() error

func (*Repo) Sync

func (m *Repo) Sync()

type RepoConfig

type RepoConfig struct {
	Id        string   `yaml:"id" validate:"repo_id"`
	Name      string   `yaml:"name"`
	Type      string   `yaml:"type" validate:"oneof=dummy reposync rsync"`
	Src       string   `yaml:"src"`
	Dest      string   `yaml:"dest" validate:"repo_path"`
	Cron      string   `yaml:"cron" validate:"repo_cron"`
	Exclude   []string `yaml:"exclude"`
	Snapshots int      `yaml:"snapshots" validate:"min=1,max=1024"`
}

type RepoMetrics

type RepoMetrics struct {
	SyncTotal    prometheus.Counter
	SyncDuration prometheus.Gauge
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL