cmd

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "GO_DISCOGS_"

Variables

View Source
var DslPattern = regexp.MustCompile(`^(mysql|postgres)://([^/]+:[^/]+)@([^/]+:\d+)(/.*)?$`)
View Source
var MonthPattern = regexp.MustCompile(`^(0?[1-9]|1[0-2])$`)
View Source
var PluralPattern = regexp.MustCompile(`^.*s$`)
View Source
var (
	Types = map[string]struct{}{
		"artists":  {},
		"labels":   {},
		"masters":  {},
		"releases": {},
	}
)
View Source
var YearPattern = regexp.MustCompile(`^\d{4}$`)

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 NewRootCommand

func NewRootCommand() *cobra.Command

func ValidChunkSize

func ValidChunkSize(chunkSizeVal string) (err error)

func ValidDsnFormat

func ValidDsnFormat(dsn string) (err error)

func ValidTypes

func ValidTypes(types []string) (err error)

func ValidYearMonth

func ValidYearMonth(y, m string) (err error)

ValidYearMonth validates year and month if it has given user command value.

Types

type ConfigValidator

type ConfigValidator interface {
	Validate(k koanf.Koanf) error
}

type HomeDirSupplier

type HomeDirSupplier interface {
	HomeUserDir() (string, error)
}

Jump to

Keyboard shortcuts

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