config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDuration

func NewDuration(duration time.Duration) *time.Duration

NewDuration returns a duration pointer

func NewFalse

func NewFalse() *bool

NewFalse returns a false bool pointer

func NewTrue

func NewTrue() *bool

NewTrue returns a true bool pointer

Types

type Config

type Config struct {
	Timezone string    `yaml:"timezone,omitempty" json:"timezone,omitempty"`
	LogLevel string    `yaml:"logLevel,omitempty" json:"logLevel,omitempty"`
	LogJSON  bool      `yaml:"logJSON,omitempty" json:"logJSON,omitempty"`
	Db       *Db       `yaml:"db,omitempty" json:"db,omitempty"`
	Server   *Server   `yaml:"server,omitempty" json:"server,omitempty"`
	Download *Download `yaml:"download,omitempty" json:"download,omitempty" validate:"required"`
	Notif    *Notif    `yaml:"notif,omitempty" json:"notif,omitempty"`
}

Config holds configuration details

type Db

type Db struct {
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
}

Db holds data necessary for database configuration

func (*Db) GetDefaults

func (s *Db) GetDefaults() *Db

GetDefaults gets the default values

func (*Db) SetDefaults

func (s *Db) SetDefaults()

SetDefaults sets the default values

type Download added in v0.7.1

type Download struct {
	Output        string      `yaml:"output,omitempty" json:"output,omitempty" validate:"required,dir"`
	UID           int         `yaml:"uid,omitempty" json:"uid,omitempty"`
	GID           int         `yaml:"gid,omitempty" json:"gid,omitempty"`
	ChmodFile     os.FileMode `yaml:"chmodFile,omitempty" json:"chmodFile,omitempty"`
	ChmodDir      os.FileMode `yaml:"chmodDir,omitempty" json:"chmodDir,omitempty"`
	Include       []string    `yaml:"include,omitempty" json:"include,omitempty"`
	Exclude       []string    `yaml:"exclude,omitempty" json:"exclude,omitempty"`
	Since         string      `yaml:"since,omitempty" json:"since,omitempty"`
	SinceTime     time.Time   `yaml:"-" json:"-" label:"-" file:"-"`
	Retry         int         `yaml:"retry,omitempty" json:"retry,omitempty"`
	HideSkipped   *bool       `yaml:"hideSkipped,omitempty" json:"hideSkipped,omitempty"`
	TempFirst     *bool       `yaml:"tempFirst,omitempty" json:"tempFirst,omitempty"`
	CreateBaseDir *bool       `yaml:"createBaseDir,omitempty" json:"createBaseDir,omitempty"`
}

Download holds download configuration details

func (*Download) GetDefaults added in v0.7.1

func (s *Download) GetDefaults() *Download

GetDefaults gets the default values

func (*Download) SetDefaults added in v0.7.1

func (s *Download) SetDefaults()

SetDefaults sets the default values

type Notif

type Notif struct {
	Mail    *NotifMail    `yaml:"mail,omitempty" json:"mail,omitempty"`
	Webhook *NotifWebhook `yaml:"webhook,omitempty" json:"webhook,omitempty"`
}

Notif holds data necessary for notification configuration

type NotifMail

type NotifMail struct {
	Host               string `yaml:"host,omitempty" json:"host,omitempty"`
	Port               int    `yaml:"port,omitempty" json:"port,omitempty"`
	SSL                *bool  `yaml:"ssl,omitempty" json:"ssl,omitempty"`
	InsecureSkipVerify *bool  `yaml:"insecureSkipVerify,omitempty" json:"insecureSkipVerify,omitempty"`
	Username           string `yaml:"username,omitempty" json:"username,omitempty"`
	UsernameFile       string `yaml:"usernameFile,omitempty" json:"usernameFile,omitempty"`
	Password           string `yaml:"password,omitempty" json:"password,omitempty"`
	PasswordFile       string `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty"`
	From               string `yaml:"from,omitempty" json:"from,omitempty"`
	To                 string `yaml:"to,omitempty" json:"to,omitempty"`
}

NotifMail holds mail notification configuration details

func (*NotifMail) GetDefaults

func (s *NotifMail) GetDefaults() *NotifMail

GetDefaults gets the default values

func (*NotifMail) SetDefaults

func (s *NotifMail) SetDefaults()

SetDefaults sets the default values

type NotifWebhook

type NotifWebhook struct {
	Endpoint string            `yaml:"endpoint,omitempty" json:"endpoint,omitempty"`
	Method   string            `yaml:"method,omitempty" json:"method,omitempty"`
	Headers  map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
	Timeout  *time.Duration    `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}

NotifWebhook holds webhook notification configuration details

func (*NotifWebhook) GetDefaults

func (s *NotifWebhook) GetDefaults() *NotifWebhook

GetDefaults gets the default values

func (*NotifWebhook) SetDefaults

func (s *NotifWebhook) SetDefaults()

SetDefaults sets the default values

type Server

type Server struct {
	FTP *ServerFTP `yaml:"ftp,omitempty" json:"ftp,omitempty"`
}

Server represents a server configuration

func (*Server) GetDefaults

func (s *Server) GetDefaults() *Server

GetDefaults gets the default values

func (*Server) SetDefaults

func (s *Server) SetDefaults()

SetDefaults sets the default values

type ServerFTP

type ServerFTP struct {
	Host               string         `yaml:"host,omitempty" json:"host,omitempty" validate:"required"`
	Port               int            `yaml:"port,omitempty" json:"port,omitempty" validate:"required,min=1"`
	Username           string         `yaml:"username,omitempty" json:"username,omitempty"`
	UsernameFile       string         `yaml:"usernameFile,omitempty" json:"usernameFile,omitempty" validate:"omitempty,file"`
	Password           string         `yaml:"password,omitempty" json:"password,omitempty"`
	PasswordFile       string         `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty" validate:"omitempty,file"`
	Sources            []string       `yaml:"sources,omitempty" json:"sources,omitempty"`
	Timeout            *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"`
	DisableUTF8        *bool          `yaml:"disableUTF8,omitempty" json:"disableUTF8,omitempty"`
	DisableEPSV        *bool          `yaml:"disableEPSV,omitempty" json:"disableEPSV,omitempty"`
	DisableMLSD        *bool          `yaml:"disableMLSD,omitempty" json:"disableMLSD,omitempty"`
	EscapeRegexpMeta   *bool          `yaml:"escapeRegexpMeta,omitempty" json:"escapeRegexpMeta,omitempty"`
	TLS                *bool          `yaml:"tls,omitempty" json:"tls,omitempty"`
	InsecureSkipVerify *bool          `yaml:"insecureSkipVerify,omitempty" json:"insecureSkipVerify,omitempty"`
	LogTrace           *bool          `yaml:"logTrace,omitempty" json:"logTrace,omitempty"`
}

ServerFTP holds ftp server configuration

func (*ServerFTP) GetDefaults

func (s *ServerFTP) GetDefaults() *ServerFTP

GetDefaults gets the default values

func (*ServerFTP) SetDefaults

func (s *ServerFTP) SetDefaults()

SetDefaults sets the default values

Jump to

Keyboard shortcuts

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