cmd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version defines the binary version at compile-time
	Version = ""

	// Commit defines the binary commit hash at compile-time
	Commit = ""

	// Branch defines the binary branch at compile-time
	Branch = ""
)

Functions

func ApplyMockIO

func ApplyMockIO(app *cli.App) (BufferReader, BufferWriter)

ApplyMockIO replaces stdout/err with buffers that can be used during testing. Returns an input BufferReader and an output BufferWriter.

func ContextWithReader

func ContextWithReader(ctx context.Context, r io.Reader) context.Context

ContextWithReader returns a Context with a given io.Reader.

func ExecTestCmd

func ExecTestCmd(ctx context.Context, app *cli.App, args []string) error

ExecCmd executes a command in a test environment with a given Context and set of arguments. If an error occurs, it is written to the App's ErrWriter.

func FlagSetFromCmdFlags

func FlagSetFromCmdFlags(name string, flags []cli.Flag) (*flag.FlagSet, error)

FlagSetFromCmdFlags returns a reference to a stdlib FlagSet given a slice of command flags.

func LoginCommand

func LoginCommand() *cli.Command

LoginCommand returns a login CLI command handler.

func NewApp

func NewApp() *cli.App

func ParseServerConfig

func ParseServerConfig(ctx *cli.Context) (*koanf.Koanf, error)

ParseServerConfig returns a server configuration, given a command Context, by parsing the following in order of precedence:

- flags - environment variables - configuration file (TOML)

func PublishCommand

func PublishCommand() *cli.Command

PublishCommand returns a CLI command handler responsible for publishing Cosmos SDK modules to the Atlas registry.

func StartServerCommand

func StartServerCommand() *cli.Command

StartServerCommand returns a CLI command handler responsible for starting the Atlas service daemon.

Types

type BufferReader

type BufferReader interface {
	io.Reader
	Reset(string)
}

BufferReader is implemented by types that read from a string buffer.

type BufferWriter

type BufferWriter interface {
	io.Writer
	Reset()
	Bytes() []byte
	String() string
}

BufferWriter is implemented by types that write to a buffer.

type CLIFlagProvider

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

CLIFlagProvider implements a simple Koanf CLI flag provider.

func NewCLIFlagProvider

func NewCLIFlagProvider(ctx *cli.Context, delim string, konfig *koanf.Koanf) *CLIFlagProvider

func (*CLIFlagProvider) Read

func (p *CLIFlagProvider) Read() (map[string]interface{}, error)

Read reads the flag variables and returns a nested conf map.

func (*CLIFlagProvider) ReadBytes

func (p *CLIFlagProvider) ReadBytes() ([]byte, error)

ReadBytes is not supported by the env koanf.

func (*CLIFlagProvider) Watch

func (p *CLIFlagProvider) Watch(cb func(event interface{}, err error)) error

Watch is not supported.

type Credentials

type Credentials struct {
	Registry Registry `json:"registry" toml:"registry"`
}

Credentials holds the registry token when a user performs a login.

type Registry

type Registry struct {
	Token string `json:"token" toml:"token"`
}

Registry defines the registries token value when a user performs a login.

Jump to

Keyboard shortcuts

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