config

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config defines all the variables that users can set (through flags, environment vars, or the config file) to affect command behavior.

The variables are grouped into a hierarchy of structs that matches the subcommand tree. Each struct defines destination fields and the mapping from command-specific flags into those fields.

These structs are defined in a separate package from the actual behavior (in the 'internal/command' package) so that nested commands can refer to the "inherited" config from parent commands without creating an import loop.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Root

	// Config file values
	Org string

	// Runtime values
	Client *client.SignadotAPI
}

func (*Api) InitAPIConfig

func (a *Api) InitAPIConfig() error

type Cluster

type Cluster struct {
	*Api
}

type ClusterConnect

type ClusterConnect struct {
	*Cluster

	// Flags
	ClusterName string
}

func (*ClusterConnect) AddFlags

func (c *ClusterConnect) AddFlags(cmd *cobra.Command)

type ClusterList

type ClusterList struct {
	*Cluster
}

type ClusterToken

type ClusterToken struct {
	*Cluster
}

type ClusterTokenCreate

type ClusterTokenCreate struct {
	*ClusterToken

	// Flags
	ClusterName string
}

func (*ClusterTokenCreate) AddFlags

func (c *ClusterTokenCreate) AddFlags(cmd *cobra.Command)

type OutputFormat

type OutputFormat string
const (
	OutputFormatDefault OutputFormat = ""
	OutputFormatYAML    OutputFormat = "yaml"
	OutputFormatJSON    OutputFormat = "json"
)

func (*OutputFormat) Set

func (o *OutputFormat) Set(v string) error

Set implements the pflag.Value interface.

func (*OutputFormat) String

func (o *OutputFormat) String() string

func (*OutputFormat) Type

func (o *OutputFormat) Type() string

Type implements the pflag.Value interface.

type Root

type Root struct {
	// Flags
	Debug        bool
	ConfigFile   string
	OutputFormat OutputFormat
}

func (*Root) AddFlags

func (c *Root) AddFlags(cmd *cobra.Command)

func (*Root) Init

func (c *Root) Init()

type Sandbox

type Sandbox struct {
	*Api
}

type SandboxCreate

type SandboxCreate struct {
	*Sandbox

	// Flags
	Filename string
	Wait     bool
}

func (*SandboxCreate) AddFlags

func (c *SandboxCreate) AddFlags(cmd *cobra.Command)

type SandboxDelete

type SandboxDelete struct {
	*Sandbox

	// Flags
	Filename string
}

func (*SandboxDelete) AddFlags

func (c *SandboxDelete) AddFlags(cmd *cobra.Command)

type SandboxGet

type SandboxGet struct {
	*Sandbox
}

type SandboxList

type SandboxList struct {
	*Sandbox
}

Jump to

Keyboard shortcuts

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