util

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLI_OPTION_RECURSION_LEVEL = 1 << iota
	CLI_OPTION_STATISTICS
	CLI_OPTION_PROGRESS
	CLI_OPTION_JSON_OUTPUT
	CLI_OPTION_MANIFEST_VERSION
	CLI_OPTION_INTERACTIVE_PASSWORD
	CLI_OPTION_TABLE_OUTPUT
	CLI_OPTION_DEBUG
	CLI_OPTION_TEMPLATE
	CLI_OPTION_TEMPLATE_SOURCE
)
View Source
const (
	CLI_OPTIONS_FULL = 0xFFFFFFFF
	CLI_OPTIONS_NONE = 0
)
View Source
const STATISTICS_TEMPLATE = `` /* 238-byte string literal not displayed */

Variables

View Source
var AutocompleteCmd = &cobra.Command{
	Use:   "autocomplete",
	Short: "Generate autocompletion snippet",
	Long:  "Generate autocompletion snippet for either bash or zsh",
}
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show version",
	Long:  "Show docker-ls version",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("version: %s\n", lib.Version())
	},
}

Functions

func AddCliConfigToFlags added in v0.3.0

func AddCliConfigToFlags(flags *pflag.FlagSet, options uint)

func AddLibraryConfigToFlags added in v0.3.0

func AddLibraryConfigToFlags(flags *pflag.FlagSet)

func DumpStatistics added in v0.3.0

func DumpStatistics(statistics connector.Statistics)

func JsonToStdout added in v0.3.0

func JsonToStdout(data interface{}) (err error)

func LibraryConfigFromViper added in v0.3.0

func LibraryConfigFromViper() (config *lib.Config, err error)

func NewProgressIndicator added in v0.3.0

func NewProgressIndicator(cfg *CliConfig) *progressIndicator

func PromptPassword

func PromptPassword(config *lib.Config) (err error)

func SerializeToStdout added in v0.3.0

func SerializeToStdout(data interface{}, cfg *CliConfig) error

func SetupViper added in v0.3.0

func SetupViper(cmd *cobra.Command)

func YamlToStdout added in v0.3.0

func YamlToStdout(data interface{}) (err error)

Types

type CliConfig added in v0.3.0

type CliConfig struct {
	RecursionLevel      uint
	ManifestVersion     uint
	Statistics          bool
	Progress            bool
	JsonOutput          bool
	InteractivePassword bool
	TableOutput         bool
	Debug               bool
	Template            string
	TemplateSource      string
	// contains filtered or unexported fields
}

func CliConfigFromViper added in v0.3.0

func CliConfigFromViper() (cfg *CliConfig, err error)

func NewCliConfig added in v0.3.0

func NewCliConfig() *CliConfig

type LibraryFlags added in v0.3.0

type LibraryFlags struct {
	RegistryUrl           string
	Pagesize              uint
	MaxConcurrentRequests uint
	BasicAuth             bool
	Username              string
	Password              string
	AllowInsecure         bool
	UserAgent             string
}

type Sortable added in v0.3.0

type Sortable interface {
	Sort()
}

type TemplateRepository added in v0.3.2

type TemplateRepository interface {
	Get(string) *template.Template
	Has(string) bool
}

func TemplateRepositoryFromConfig added in v0.3.2

func TemplateRepositoryFromConfig() (t TemplateRepository, err error)

Jump to

Keyboard shortcuts

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