cli

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cli contains the RootCmd for main and utilities for printing.

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:     "vanity",
	Short:   "A go vanity server",
	Long:    `A go vanity server`,
	Version: getVersion(),
}

RootCmd is the root cobra command for vanity.

View Source
var Version = "<unspecified>"

Version is the version of the vanity command.

Functions

func FileExists

func FileExists(path string) bool

FileExists returns true if the file exists, false otherwise.

func NewJSONConsumer

func NewJSONConsumer() vanity.Consumer

NewJSONConsumer creates a Consumer that prints vanity URL configurations to standard output as a JSON object.

func NewPlainConsumer

func NewPlainConsumer() vanity.Consumer

NewPlainConsumer creates a Consumer that prints vanity URL configurations to standard output as plainConsumer comma-delimited text.

func SHA1FromJSON

func SHA1FromJSON(doc string) (string, error)

SHA1FromJSON generates a SHA1 hash from a canonical JSON object.

func SHA1FromString

func SHA1FromString(s string) string

SHA1FromString generates a SHA1 hash from a string.

Types

type FlagSet

type FlagSet struct {
	*pflag.FlagSet
}

FlagSet extends pflag.FlagSet with methods that obtain values from the environment.

func Flags

func Flags(cmd *cobra.Command) *FlagSet

Flags returns the a wrapped FlagSet that applies to this command (local and persistent declared here and by all parents).

func (*FlagSet) GetValue

func (f *FlagSet) GetValue(flagName string) (value string, found bool)

GetValue is a utility that attempts to obtain a value from the command line and if there's no value, then it attempts to obtain the value from the environmental variable.

Directories

Path Synopsis
Package backends contains the shared implementation of vanity.Backend.
Package backends contains the shared implementation of vanity.Backend.
gcp
Package gcp declares common Google API clients options.
Package gcp declares common Google API clients options.
gcp/datastore
Package datastore contains the datastore sub-command.
Package datastore contains the datastore sub-command.
gcp/spanner
Package spanner contains the spanner sub-command.
Package spanner contains the spanner sub-command.
helpers
Package helpers provides a way for sub-commands to register themselves with backend implementations.
Package helpers provides a way for sub-commands to register themselves with backend implementations.
Package log contains log level constants for glog.
Package log contains log level constants for glog.

Jump to

Keyboard shortcuts

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