cmd

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigNotFound = errors.New("could not read local credentials. Are you logged in? Use \"infra login\" to login")

Functions

func NewAPIClient added in v0.4.0

func NewAPIClient(host string, skipTLSVerify bool) (*api.APIClient, error)

func NewAPIContext added in v0.4.0

func NewAPIContext(token string) context.Context

func NewRootCmd added in v0.0.3

func NewRootCmd() (*cobra.Command, error)

func Run

func Run() error

Types

type ClientConfig added in v0.4.0

type ClientConfig struct {
	Version string             `json:"version"`
	Hosts   []ClientHostConfig `json:"hosts"`
}

current: v0.3

func NewClientConfig added in v0.3.0

func NewClientConfig() *ClientConfig

type ClientConfigV0dot1 added in v0.3.0

type ClientConfigV0dot1 struct {
	Version       string `json:"version"` // always blank in v0.1
	Name          string `json:"name"`
	Host          string `json:"host"`
	Token         string `json:"token"`
	SkipTLSVerify bool   `json:"skip-tls-verify"`
	SourceID      string `json:"source-id"`
}

func (ClientConfigV0dot1) ToV0dot2 added in v0.3.0

func (c ClientConfigV0dot1) ToV0dot2() *ClientConfigV0dot2

ToV0dot2 upgrades the config to the 0.2 version

type ClientConfigV0dot2 added in v0.3.0

type ClientConfigV0dot2 struct {
	Version string                   `json:"version"` // v0.2
	Hosts   []ClientHostConfigV0dot2 `json:"hosts"`
}

func (ClientConfigV0dot2) ToV0dot3 added in v0.4.0

func (c ClientConfigV0dot2) ToV0dot3() *ClientConfig

ToV0dot3 upgrades the config to the 0.3 version

type ClientHostConfig added in v0.4.0

type ClientHostConfig struct {
	Name          string `json:"name"`
	Host          string `json:"host"`
	Token         string `json:"token"`
	SkipTLSVerify bool   `json:"skip-tls-verify"` // where is the other cert info stored?
	ProviderID    string `json:"provider-id"`
	Current       bool   `json:"current"`
}

current: v0.3

type ClientHostConfigV0dot2 added in v0.4.0

type ClientHostConfigV0dot2 struct {
	Name          string `json:"name"`
	Host          string `json:"host"`
	Token         string `json:"token"`
	SkipTLSVerify bool   `json:"skip-tls-verify"`
	SourceID      string `json:"source-id"`
	Current       bool   `json:"current"`
}

type CodeResponse

type CodeResponse struct {
	Code  string
	State string
	Error error
}

type ErrResultTimedOut added in v0.3.2

type ErrResultTimedOut struct{}

func (*ErrResultTimedOut) Error added in v0.3.2

func (e *ErrResultTimedOut) Error() string

type ListOptions added in v0.4.0

type ListOptions struct {
	internal.Options `mapstructure:",squash"`
}

type LocalServer

type LocalServer struct {
	ResultChan chan CodeResponse
	// contains filtered or unexported fields
}

type LoginOptions added in v0.3.2

type LoginOptions struct {
	Current          bool          `mapstructure:"current"`
	Timeout          time.Duration `mapstructure:"timeout"`
	internal.Options `mapstructure:",squash"`
}

type LogoutOptions added in v0.4.0

type LogoutOptions struct {
	internal.Options `mapstructure:",squash"`
}

type TokenOptions added in v0.4.0

type TokenOptions struct {
	Destination      string
	internal.Options `mapstructure:",squash"`
}

type VersionOptions added in v0.3.0

type VersionOptions struct {
	Client           bool
	Server           bool
	internal.Options `mapstructure:",squash"`
}

Jump to

Keyboard shortcuts

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