cmd

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func SetVersion added in v1.1.0

func SetVersion(_version string)

SetVersion will set the version of the cmd package

func Version added in v1.1.0

func Version() string

Version will return the set version of cmd package

Types

type Config

type Config struct {
	PrimaryKeyPositions    []int
	ValueColumnPositions   []int
	IncludeColumnPositions []int
	Format                 string
}

Config is to store all command line Flags.

func (*Config) GetIncludeColumnPositions added in v1.1.0

func (c *Config) GetIncludeColumnPositions() digest.Positions

GetIncludeColumnPositions is to return the --include flags as digest.Positions array. If empty, it is value columns

func (*Config) GetPrimaryKeys

func (c *Config) GetPrimaryKeys() digest.Positions

GetPrimaryKeys is to return the --primary-key flags as digest.Positions array.

func (*Config) GetValueColumns

func (c *Config) GetValueColumns() digest.Positions

GetValueColumns is to return the --columns flags as digest.Positions array.

func (*Config) Validate added in v1.0.0

func (c *Config) Validate() error

Validate validates the config object and returns error if not valid.

type Formatter added in v1.0.0

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter can print the differences to stdout and accompanying metadata to stderr

func NewFormatter added in v1.2.0

func NewFormatter(stdout, stderr io.Writer, config Config) *Formatter

NewFormatter can be used to create a new formatter

func (*Formatter) Format added in v1.0.0

func (f *Formatter) Format(diff digest.Differences) error

Format can be used to format the differences based on config to appropriate writers

Jump to

Keyboard shortcuts

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