dump

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "2006-01-02_150405"

Variables

View Source
var Command = &cobra.Command{
	Use:     "dump [filename]",
	Aliases: []string{"d", "export"},
	Short:   "dump a database to a sql file",
	Long: `The "dump" command dumps a running database to a sql file.

If no filename is provided, the filename will be generated.
For example, if a dump is performed in the namespace "clevyr" with no extra flags,
the generated filename might look like "` + HelpFilename() + `"`,

	Args:              cobra.MaximumNArgs(1),
	ValidArgsFunction: validArgs,

	PreRunE: preRun,
	RunE:    run,

	Annotations: map[string]string{
		"access": strconv.Itoa(config.ReadOnly),
	},
}
View Source
var FilenameTemplate = fmt.Sprintf("{{ .Namespace }}_{{ .Date.Format %#v }}{{ .Ext }}", DateFormat)

Functions

func HelpFilename

func HelpFilename() string

Types

type Filename

type Filename struct {
	Namespace string
	Ext       string
	Date      time.Time
}

func (Filename) Generate

func (vars Filename) Generate() (string, error)

Jump to

Keyboard shortcuts

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