ctx

package
v0.0.0-...-c600a59 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 51 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        command
	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   notificationsConf    `conf:"notifications"`
	Jobs            []jobConf            `conf:"jobs"`
	StorageConnects []storageConnectConf `conf:"storage_connects"`
	IncludeCfgs     []string             `conf:"include_jobs_configs"`
	WaitingTimeout  time.Duration        `conf:"waiting_timeout"`

	Server serverConf  `conf:"server"`
	Limits *limitsConf `conf:"limits" conf_extraopts:"default={}"`

	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     misc.BackupType   `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 ListCmd

type ListCmd struct {
	Backups *StartCmd `arg:"subcommand:backups"`
}

type ServerCmd

type ServerCmd struct{}

ServerCmd "Running the nxs-backup in server mode"

type StartCmd

type StartCmd struct {
	JobName string `arg:"positional" help:"Name of job or jobs group to run [default: all]" default:"all" placeholder:"JOB_NAME/GROUP_NAME"`
}

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