command

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Latticectl        = "latticectl"
	DefaultConfigFile = "config.json"
)
View Source
const (
	ConfigFlagName  = "config"
	ContextFlagName = "context"
	OutputFlagName  = "output"
	SidecarFlagName = "sidecar"
	SystemFlagName  = "system"
	WatchFlagName   = "watch"
)

Variables

This section is empty.

Functions

func ConfigFlag

func ConfigFlag(target *string) *flags.String

func ContextFlag

func ContextFlag(target *string) *flags.String

func OutputFlag

func OutputFlag(target *string, supported []printer.Format, defaultFormat printer.Format) *flags.String

func SidecarFlag

func SidecarFlag(target *string) *flags.String

func SystemFlag

func SystemFlag(target *string) *flags.String

func WatchFlag

func WatchFlag(target *bool) *flags.Bool

Types

type AuthContext

type AuthContext struct {
	BearerToken *string `json:"bearerToken"`
}

type Config

type Config struct {
	CurrentContext string             `json:"currentContext"`
	Contexts       map[string]Context `json:"contexts"`
}

type ConfigFile

type ConfigFile struct {
	Path string
	// contains filtered or unexported fields
}

func (*ConfigFile) Config

func (c *ConfigFile) Config() (*Config, error)

func (*ConfigFile) Context

func (c *ConfigFile) Context(name string) (*Context, error)

func (*ConfigFile) Contexts

func (c *ConfigFile) Contexts() (map[string]Context, error)

func (*ConfigFile) CreateContext

func (c *ConfigFile) CreateContext(name string, context *Context) error

func (*ConfigFile) CurrentContext

func (c *ConfigFile) CurrentContext() (string, error)

func (*ConfigFile) DeleteContext

func (c *ConfigFile) DeleteContext(name string) error

func (*ConfigFile) SetCurrentContext

func (c *ConfigFile) SetCurrentContext(context string) error

func (*ConfigFile) UnsetCurrentContext

func (c *ConfigFile) UnsetCurrentContext() error

func (*ConfigFile) UpdateContext

func (c *ConfigFile) UpdateContext(name string, context *Context) error

type Context

type Context struct {
	URL    string       `json:"lattice"`
	System v1.SystemID  `json:"system,omitempty"`
	Auth   *AuthContext `json:"auth"`
}

type ContextAlreadyExistsError

type ContextAlreadyExistsError struct {
	Context string
}

func NewContextAlreadyExistsError

func NewContextAlreadyExistsError(context string) *ContextAlreadyExistsError

func (*ContextAlreadyExistsError) Error

func (e *ContextAlreadyExistsError) Error() string

type InvalidContextError

type InvalidContextError struct {
	Context string
}

func NewInvalidContextError

func NewInvalidContextError(context string) *InvalidContextError

func (*InvalidContextError) Error

func (e *InvalidContextError) Error() string

type LatticeCommand

type LatticeCommand struct {
	Short                  string
	Args                   cli.Args
	Flags                  cli.Flags
	Run                    func(ctx *LatticeCommandContext, args []string, flags cli.Flags) error
	MutuallyExclusiveFlags [][]string
	RequiredFlagSet        [][]string
	Subcommands            map[string]*cli.Command
}

func (*LatticeCommand) Command

func (c *LatticeCommand) Command() *cli.Command

type LatticeCommandContext

type LatticeCommandContext struct {
	Context *Context
	Lattice string
	Client  client.Interface
}

type NoContextSetError

type NoContextSetError struct{}

func NewNoContextSetError

func NewNoContextSetError() *NoContextSetError

func (*NoContextSetError) Error

func (e *NoContextSetError) Error() string

type SystemCommand

type SystemCommand struct {
	Name                   string
	Short                  string
	Args                   cli.Args
	Flags                  cli.Flags
	Run                    func(ctx *SystemCommandContext, args []string, flags cli.Flags) error
	MutuallyExclusiveFlags [][]string
	RequiredFlagSet        [][]string
	Subcommands            map[string]*cli.Command
}

func (*SystemCommand) Command

func (c *SystemCommand) Command() *cli.Command

type SystemCommandContext

type SystemCommandContext struct {
	*LatticeCommandContext
	System v1.SystemID
}

Jump to

Keyboard shortcuts

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