client

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigcheckCmd = &cli.Subcommand{
	Use:   "configcheck",
	Short: "check if config can be parsed without errors",

	ConfigWithIncludes: true,

	SetupFlags: func(f *pflag.FlagSet) {
		f.StringVar(&configcheckArgs.format, "format", "",
			"dump parsed config object [yaml|json]")
		f.StringVar(&configcheckArgs.what, "what", "all",
			"what to print [all|config|jobs|logging]")
	},

	Run: func(_ context.Context, subcommand *cli.Subcommand, _ []string) error {
		return checkConfig(subcommand)
	},
}
View Source
var MigrateCmd = &cli.Subcommand{
	Use:   "migrate",
	Short: "perform migration of the on-disk / zfs properties",
	SetupSubcommands: func() []*cli.Subcommand {
		return migrations
	},
}
View Source
var SignalCmd = &cli.Subcommand{
	Use:   "signal {reload | reset JOB | shutdown | stop | wakeup JOB}",
	Short: "send a signal to the daemon",
	Long: `Send a signal to the daemon.

Expected signals:
  reload   Reload TLS certificates
  reset    Abort job's current invocation
  shutdown Stop daemon gracefully
  stop     Stop daemon right now
  wakeup   Wake up job from wait state
`,

	SetupCobra: func(cmd *cobra.Command) {
		cmd.ValidArgs = []string{"reload", "reset", "shutdown", "stop", "wakeup"}
		cmd.Args = cobra.MatchAll(cobra.MinimumNArgs(1),
			func(cmd *cobra.Command, args []string) error {
				switch args[0] {
				case "reload", "shutdown", "stop":
					return cobra.ExactArgs(1)(cmd, args)
				case "reset", "wakeup":
					return cobra.ExactArgs(2)(cmd, args)
				}
				return cobra.OnlyValidArgs(cmd, args)
			})
	},

	Run: func(ctx context.Context, subcommand *cli.Subcommand,
		args []string,
	) error {
		return runSignalCmd(subcommand.Config(), args)
	},
}
View Source
var TestCmd = &cli.Subcommand{
	Use: "test",
	SetupSubcommands: func() []*cli.Subcommand {
		return []*cli.Subcommand{testFilter, testPlaceholder, testDecodeResumeToken}
	},
}
View Source
var VersionCmd = &cli.Subcommand{
	Use:             "version",
	Short:           "print version of zrepl binary and running daemon",
	NoRequireConfig: true,
	SetupFlags: func(f *pflag.FlagSet) {
		f.StringVar(&versionArgs.Show, "show", "", "version info to show (client|daemon)")
	},
	Run: func(ctx context.Context, subcommand *cli.Subcommand, args []string) error {
		versionArgs.Config = subcommand.Config()
		versionArgs.ConfigErr = subcommand.ConfigParsingError()
		return runVersionCmd()
	},
}
View Source
var ZFSAbstractionsCmd = &cli.Subcommand{
	Use:   "zfs-abstraction",
	Short: "manage abstractions that zrepl builds on top of ZFS",
	SetupSubcommands: func() []*cli.Subcommand {
		return []*cli.Subcommand{
			zabsCmdList,
			zabsCmdReleaseAll,
			zabsCmdReleaseStale,
			zabsCmdCreate,
		}
	},
}

Functions

This section is empty.

Types

type AbstractionTypesFlag

type AbstractionTypesFlag map[endpoint.AbstractionType]bool

func (AbstractionTypesFlag) FlagValue

func (*AbstractionTypesFlag) Set

func (f *AbstractionTypesFlag) Set(s string) error

func (AbstractionTypesFlag) String

func (f AbstractionTypesFlag) String() string

func (AbstractionTypesFlag) Type

func (f AbstractionTypesFlag) Type() string

type FilesystemsFilterFlag

type FilesystemsFilterFlag struct {
	F endpoint.ListZFSHoldsAndBookmarksQueryFilesystemFilter
}

func (FilesystemsFilterFlag) FlagValue

func (*FilesystemsFilterFlag) Set

func (flag *FilesystemsFilterFlag) Set(s string) error

func (FilesystemsFilterFlag) String

func (flag FilesystemsFilterFlag) String() string

func (FilesystemsFilterFlag) Type

func (flag FilesystemsFilterFlag) Type() string

type JobIDFlag

type JobIDFlag struct{ J *endpoint.JobID }

func (JobIDFlag) FlagValue

func (f JobIDFlag) FlagValue() *endpoint.JobID

func (*JobIDFlag) Set

func (f *JobIDFlag) Set(s string) error

func (JobIDFlag) String

func (f JobIDFlag) String() string

func (JobIDFlag) Type

func (f JobIDFlag) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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