ctx

package
v0.0.0-...-1d5d43e Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppCtxInit

func AppCtxInit() (any, error)

Types

type ArgsParams

type ArgsParams struct {
	ConfigPath string
	Cmd        string
	CmdParams  interface{}
	Arg        *arg.Parser
}

ArgsParams contains parameters read from command line, command parameters and command handler

func ReadArgs

func ReadArgs() (p ArgsParams, err error)

ReadArgs reads arguments from command line

type ConfOpts

type ConfOpts struct {
	ProjectName     string           `conf:"project_name"`
	ServerName      string           `conf:"server_name" conf_extraopts:"default=localhost"`
	Notifications   notifications    `conf:"notifications"`
	Jobs            []jobCfg         `conf:"jobs"`
	StorageConnects []storageConnect `conf:"storage_connects"`
	IncludeCfgs     []string         `conf:"include_jobs_configs"`
	WaitingTimeout  time.Duration    `conf:"waiting_timeout"`

	LogFile  string `conf:"logfile" conf_extraopts:"default=stdout"`
	LogLevel string `conf:"loglevel" conf_extraopts:"default=info"`
	ConfPath string
}

type Ctx

type Ctx struct {
	Cmd       interfaces.Handler
	Log       *logrus.Logger
	Done      chan error
	EventCh   chan logger.LogRecord
	EventsWG  *sync.WaitGroup
	Notifiers []interfaces.Notifier
}

Ctx defines application custom context

type GenerateCmd

type GenerateCmd struct {
	Type     string            `arg:"-T,--backup-type,required" help:"Type of backup"`
	Storages map[string]string `arg:"-S,--storage-types" help:"Storages names with type. Example: -S minio=s3 aws=s3"`
	OutPath  string            `arg:"-O,--out-path" help:"Path to the generated configuration file" placeholder:"PATH"`
}

type StartCmd

type StartCmd struct {
	JobName string `arg:"positional" placeholder:"JOB GROUP/NAME" default:"all"`
}

type UpdateCmd

type UpdateCmd struct {
	Version string `arg:"-V,--set-version" help:"Use the specific version to update. Example: -V 3.2.0-rc0" default:"3"`
}

Jump to

Keyboard shortcuts

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