options

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BACKUP_DIR            = "backup-dir"
	COMPRESSION_TYPE      = "compression-type"
	COMPRESSION_LEVEL     = "compression-level"
	DATA_ONLY             = "data-only"
	DBNAME                = "dbname"
	DEBUG                 = "debug"
	EXCLUDE_RELATION      = "exclude-table"
	EXCLUDE_RELATION_FILE = "exclude-table-file"
	EXCLUDE_SCHEMA        = "exclude-schema"
	EXCLUDE_SCHEMA_FILE   = "exclude-schema-file"
	FROM_TIMESTAMP        = "from-timestamp"
	INCLUDE_RELATION      = "include-table"
	INCLUDE_RELATION_FILE = "include-table-file"
	INCLUDE_SCHEMA        = "include-schema"
	INCLUDE_SCHEMA_FILE   = "include-schema-file"
	INCREMENTAL           = "incremental"
	JOBS                  = "jobs"
	LEAF_PARTITION_DATA   = "leaf-partition-data"
	METADATA_ONLY         = "metadata-only"
	NO_COMPRESSION        = "no-compression"
	PLUGIN_CONFIG         = "plugin-config"
	QUIET                 = "quiet"
	SINGLE_DATA_FILE      = "single-data-file"
	COPY_QUEUE_SIZE       = "copy-queue-size"
	VERBOSE               = "verbose"
	WITH_STATS            = "with-stats"
	CREATE_DB             = "create-db"
	ON_ERROR_CONTINUE     = "on-error-continue"
	REDIRECT_DB           = "redirect-db"
	RUN_ANALYZE           = "run-analyze"
	TIMESTAMP             = "timestamp"
	WITH_GLOBALS          = "with-globals"
	REDIRECT_SCHEMA       = "redirect-schema"
	TRUNCATE_TABLE        = "truncate-table"
	WITHOUT_GLOBALS       = "without-globals"
	RESIZE_CLUSTER        = "resize-cluster"
)

Variables

This section is empty.

Functions

func CheckExclusiveFlags

func CheckExclusiveFlags(flags *pflag.FlagSet, flagNames ...string)

At most one of the flags passed to this function may be set

func ExtensionFilterClause

func ExtensionFilterClause(namespace string) string

func HandleSingleDashes

func HandleSingleDashes(args []string) []string

* Convert arguments that contain a single dash to double dashes for backward * compatibility.

func MustGetFlagBool

func MustGetFlagBool(cmdFlags *pflag.FlagSet, flagName string) bool

func MustGetFlagInt

func MustGetFlagInt(cmdFlags *pflag.FlagSet, flagName string) int

func MustGetFlagString

func MustGetFlagString(cmdFlags *pflag.FlagSet, flagName string) string

func MustGetFlagStringArray

func MustGetFlagStringArray(cmdFlags *pflag.FlagSet, flagName string) []string

func MustGetFlagStringSlice

func MustGetFlagStringSlice(cmdFlags *pflag.FlagSet, flagName string) []string

func QuoteTableNames

func QuoteTableNames(conn *dbconn.DBConn, tableNames []string) ([]string, error)

func SetBackupFlagDefaults

func SetBackupFlagDefaults(flagSet *pflag.FlagSet)

func SetRestoreFlagDefaults

func SetRestoreFlagDefaults(flagSet *pflag.FlagSet)

Types

type FqnStruct

type FqnStruct struct {
	SchemaName string
	TableName  string
}

func SeparateSchemaAndTable

func SeparateSchemaAndTable(tableNames []string) ([]FqnStruct, error)

type Options

type Options struct {
	IncludedRelations []string
	ExcludedRelations []string

	ExcludedSchemas []string
	IncludedSchemas []string

	RedirectSchema string
	// contains filtered or unexported fields
}

This is meant to be a read only package. Values inside should only be modified by setters, it's method functions, or initialization function. This package is meant to make mocking flags easier.

func NewOptions

func NewOptions(initialFlags *pflag.FlagSet) (*Options, error)

func (*Options) AddIncludedRelation

func (o *Options) AddIncludedRelation(relation string)

func (*Options) ExpandIncludesForPartitions

func (o *Options) ExpandIncludesForPartitions(conn *dbconn.DBConn, flags *pflag.FlagSet) error

func (Options) GetExcludedSchemas

func (o Options) GetExcludedSchemas() []string

func (Options) GetExcludedTables

func (o Options) GetExcludedTables() []string

func (Options) GetIncludedSchemas

func (o Options) GetIncludedSchemas() []string

func (Options) GetIncludedTables

func (o Options) GetIncludedTables() []string

func (Options) GetOriginalIncludedTables

func (o Options) GetOriginalIncludedTables() []string

func (Options) IsLeafPartitionData

func (o Options) IsLeafPartitionData() bool

func (*Options) QuoteExcludeRelations

func (o *Options) QuoteExcludeRelations(conn *dbconn.DBConn) error

func (*Options) QuoteIncludeRelations

func (o *Options) QuoteIncludeRelations(conn *dbconn.DBConn) error

Jump to

Keyboard shortcuts

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