Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶ added in v7.1.0
type Cli struct { Version kong.VersionFlag Cfgfile string `kong:"name='config',env='CONFIG',help='FTPGrab configuration file.'"` Schedule string `kong:"name='schedule',env='SCHEDULE',help='CRON expression format.'"` LogLevel string `kong:"name='log-level',env='LOG_LEVEL',default='info',help='Set log level.'"` LogJSON bool `kong:"name='log-json',env='LOG_JSON',default='false',help='Enable JSON logging output.'"` LogTimestamp bool `` /* 138-byte string literal not displayed */ LogCaller bool `kong:"name='log-caller',env='LOG_CALLER',default='false',help='Add file:line of the caller to log output.'"` LogFile string `kong:"name='log-file',env='LOG_FILE',help='Add logging to a specific file.'"` }
Cli holds command line args, flags and cmds
type Config ¶
type Config struct { Cli Cli `yaml:"-" json:"-" label:"-" file:"-"` Meta Meta `yaml:"-" json:"-" label:"-" file:"-"` Db *Db `yaml:"db,omitempty" json:"db,omitempty" validate:"omitempty"` Server *Server `yaml:"server,omitempty" json:"server,omitempty" validate:"required"` Download *Download `yaml:"download,omitempty" json:"download,omitempty" validate:"required"` Notif *Notif `yaml:"notif,omitempty" json:"notif,omitempty"` }
Config holds configuration details
type Db ¶ added in v7.1.0
type Db struct {
Path string `yaml:"path,omitempty" json:"path,omitempty" validate:"required"`
}
Db holds data necessary for database configuration
func (*Db) GetDefaults ¶ added in v7.1.0
GetDefaults gets the default values
func (*Db) SetDefaults ¶ added in v7.1.0
func (s *Db) SetDefaults()
SetDefaults sets the default values
type Download ¶ added in v7.1.0
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 v7.1.0
GetDefaults gets the default values
func (*Download) SetDefaults ¶ added in v7.1.0
func (s *Download) SetDefaults()
SetDefaults sets the default values
type Meta ¶ added in v7.1.0
type Meta struct { ID string Name string Desc string URL string Logo string Author string Version string UserAgent string Hostname string }
Meta holds application details
type Notif ¶ added in v7.1.0
type Notif struct { Mail *NotifMail `yaml:"mail,omitempty" json:"mail,omitempty"` Script *NotifScript `yaml:"script,omitempty" json:"script,omitempty"` Slack *NotifSlack `yaml:"slack,omitempty" json:"slack,omitempty"` Webhook *NotifWebhook `yaml:"webhook,omitempty" json:"webhook,omitempty"` }
Notif holds data necessary for notification configuration
func (*Notif) GetDefaults ¶ added in v7.1.0
GetDefaults gets the default values
func (*Notif) SetDefaults ¶ added in v7.1.0
func (s *Notif) SetDefaults()
SetDefaults sets the default values
type NotifMail ¶ added in v7.1.0
type NotifMail struct { Host string `yaml:"host,omitempty" json:"host,omitempty" validate:"required"` Port int `yaml:"port,omitempty" json:"port,omitempty" validate:"required,min=1"` SSL *bool `yaml:"ssl,omitempty" json:"ssl,omitempty" validate:"required"` InsecureSkipVerify *bool `yaml:"insecureSkipVerify,omitempty" json:"insecureSkipVerify,omitempty" validate:"required"` Username string `yaml:"username,omitempty" json:"username,omitempty" validate:"omitempty"` UsernameFile string `yaml:"usernameFile,omitempty" json:"usernameFile,omitempty" validate:"omitempty,file"` Password string `yaml:"password,omitempty" json:"password,omitempty" validate:"omitempty"` PasswordFile string `yaml:"passwordFile,omitempty" json:"passwordFile,omitempty" validate:"omitempty,file"` From string `yaml:"from,omitempty" json:"from,omitempty" validate:"required,email"` To string `yaml:"to,omitempty" json:"to,omitempty" validate:"required,email"` }
NotifMail holds mail notification configuration details
func (*NotifMail) GetDefaults ¶ added in v7.1.0
GetDefaults gets the default values
func (*NotifMail) SetDefaults ¶ added in v7.1.0
func (s *NotifMail) SetDefaults()
SetDefaults sets the default values
type NotifScript ¶ added in v7.2.0
type NotifScript struct { Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty" validate:"required"` Args []string `yaml:"args,omitempty" json:"args,omitempty" validate:"omitempty"` Dir string `yaml:"dir,omitempty" json:"dir,omitempty" validate:"omitempty,dir"` }
NotifScript holds script notification configuration details
func (*NotifScript) GetDefaults ¶ added in v7.2.0
func (s *NotifScript) GetDefaults() *NotifScript
GetDefaults gets the default values
func (*NotifScript) SetDefaults ¶ added in v7.2.0
func (s *NotifScript) SetDefaults()
SetDefaults sets the default values
type NotifSlack ¶ added in v7.1.0
type NotifSlack struct {
WebhookURL string `yaml:"webhookURL,omitempty" json:"webhookURL,omitempty" validate:"required"`
}
NotifSlack holds slack notification configuration details
func (*NotifSlack) GetDefaults ¶ added in v7.1.0
func (s *NotifSlack) GetDefaults() *NotifSlack
GetDefaults gets the default values
func (*NotifSlack) SetDefaults ¶ added in v7.1.0
func (s *NotifSlack) SetDefaults()
SetDefaults sets the default values
type NotifWebhook ¶ added in v7.1.0
type NotifWebhook struct { Endpoint string `yaml:"endpoint,omitempty" json:"endpoint,omitempty" validate:"required"` Method string `yaml:"method,omitempty" json:"method,omitempty" validate:"required"` Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty" validate:"omitempty"` Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty" validate:"required"` }
NotifWebhook holds webhook notification configuration details
func (*NotifWebhook) GetDefaults ¶ added in v7.1.0
func (s *NotifWebhook) GetDefaults() *NotifWebhook
GetDefaults gets the default values
func (*NotifWebhook) SetDefaults ¶ added in v7.1.0
func (s *NotifWebhook) SetDefaults()
SetDefaults sets the default values
type Server ¶ added in v7.1.0
type Server struct { FTP *ServerFTP `yaml:"ftp,omitempty" json:"ftp,omitempty"` SFTP *ServerSFTP `yaml:"sftp,omitempty" json:"sftp,omitempty"` }
Server represents a server configuration
func (*Server) GetDefaults ¶ added in v7.1.0
GetDefaults gets the default values
func (*Server) SetDefaults ¶ added in v7.1.0
func (s *Server) SetDefaults()
SetDefaults sets the default values
type ServerCommon ¶ added in v7.1.0
ServerCommon holds common data server configuration
type ServerFTP ¶ added in v7.1.0
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 ¶ added in v7.1.0
GetDefaults gets the default values
func (*ServerFTP) SetDefaults ¶ added in v7.1.0
func (s *ServerFTP) SetDefaults()
SetDefaults sets the default values
type ServerSFTP ¶ added in v7.1.0
type ServerSFTP 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"` KeyFile string `yaml:"keyFile,omitempty" json:"keyFile,omitempty" validate:"omitempty,file"` KeyPassphrase string `yaml:"keyPassphrase,omitempty" json:"keyPassphrase,omitempty"` KeyPassphraseFile string `yaml:"keyPassphraseFile,omitempty" json:"keyPassphraseFile,omitempty" validate:"omitempty,file"` Sources []string `yaml:"sources,omitempty" json:"sources,omitempty"` Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"` MaxPacketSize int `yaml:"maxPacketSize,omitempty" json:"maxPacketSize,omitempty"` }
ServerSFTP holds sftp server configuration
func (*ServerSFTP) GetDefaults ¶ added in v7.1.0
func (s *ServerSFTP) GetDefaults() *ServerSFTP
GetDefaults gets the default values
func (*ServerSFTP) SetDefaults ¶ added in v7.1.0
func (s *ServerSFTP) SetDefaults()
SetDefaults sets the default values