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
- Variables
- type API
- func (a *API) APIClientWithCustomTransport(conf *transport.APIConfig, execute func(client *client.SignadotAPI) error) error
- func (a *API) GetBaseTransport() *transport.APIConfig
- func (a *API) InitAPIConfig() error
- func (a *API) InitAPITransport() error
- func (a *API) MarshalJSON() ([]byte, error)
- func (a *API) MarshalYAML() ([]byte, error)
- type Artifact
- type ArtifactDownload
- type Cluster
- type ClusterAdd
- type ClusterList
- type ClusterToken
- type ClusterTokenCreate
- type ClusterTokenDelete
- type ClusterTokenList
- type ConnectInvocationConfig
- type ConnectInvocationUser
- type ConnectWait
- type Job
- type JobDelete
- type JobGet
- type JobList
- type JobRunnerGroup
- type JobRunnerGroupApply
- type JobRunnerGroupDelete
- type JobRunnerGroupGet
- type JobRunnerGroupList
- type JobSubmit
- type Local
- type LocalConnect
- type LocalDaemon
- type LocalDisconnect
- type LocalProxy
- type LocalStatus
- type Logs
- type OutputFormat
- type ProxyMapping
- type ResourcePlugin
- type ResourcePluginApply
- type ResourcePluginDelete
- type ResourcePluginGet
- type ResourcePluginList
- type Root
- type RouteGroup
- type RouteGroupApply
- type RouteGroupDelete
- type RouteGroupGet
- type RouteGroupList
- type Sandbox
- type SandboxApply
- type SandboxDelete
- type SandboxGet
- type SandboxList
- type TemplateVal
- type TemplateVals
- type Test
- type TestApply
- type TestDelete
- type TestExec
- type TestExecCancel
- type TestExecGet
- type TestExecList
- type TestGet
- type TestList
- type TestRun
Constants ¶
const (
RootManagerPIDFile = "rootmanager.pid"
SandboxManagerPIDFile = "sandboxmanager.pid"
RootManagerLogFile = "root-manager.log"
SandboxManagerLogFile = "sandbox-manager.log"
)
const (
DefaultVirtualIPNet = "242.242.0.1/16"
)
Variables ¶
var (
VarRx = regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_.-]*$`)
)
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v0.3.3
type API struct {
Root
// Config file values
Org string
MaskedAPIKey string
APIURL string
ArtifactsAPIURL string
// Runtime values
Client *client.SignadotAPI `json:"-"`
ApiKey string
UserAgent string
}
func (*API) APIClientWithCustomTransport ¶ added in v0.8.0
func (a *API) APIClientWithCustomTransport(conf *transport.APIConfig,
execute func(client *client.SignadotAPI) error) error
func (*API) GetBaseTransport ¶ added in v0.8.0
func (a *API) GetBaseTransport() *transport.APIConfig
func (*API) InitAPIConfig ¶ added in v0.3.3
func (a *API) InitAPIConfig() error
func (*API) InitAPITransport ¶ added in v0.5.0
func (a *API) InitAPITransport() error
func (*API) MarshalJSON ¶ added in v0.3.3
func (a *API) MarshalJSON() ([]byte, error)
for error reporting, we select the config that the user controls.
func (*API) MarshalYAML ¶ added in v0.5.0
func (a *API) MarshalYAML() ([]byte, error)
type ArtifactDownload ¶ added in v0.8.0
type ArtifactDownload struct {
*Artifact
// Flags
Job string
OutputFile string
}
type ClusterAdd ¶ added in v0.2.0
type ClusterAdd struct {
*Cluster
// Flags
ClusterName string
}
type ClusterList ¶
type ClusterList struct {
*Cluster
}
type ClusterToken ¶
type ClusterToken struct {
*Cluster
}
type ClusterTokenCreate ¶
type ClusterTokenCreate struct {
*ClusterToken
// Flags
ClusterName string
}
type ClusterTokenDelete ¶ added in v0.2.0
type ClusterTokenDelete struct {
*ClusterToken
// Flags
ClusterName string
}
type ClusterTokenList ¶ added in v0.2.0
type ClusterTokenList struct {
*ClusterToken
// Flags
ClusterName string
}
type ConnectInvocationConfig ¶ added in v0.5.0
type ConnectInvocationConfig struct {
WithRootManager bool `json:"withRootManager"`
APIPort uint16 `json:"apiPort"`
LocalNetPort uint16 `json:"localNetPort"`
SignadotDir string `json:"signadotDir"`
User *ConnectInvocationUser `json:"user"`
VirtualIPNet string `json:"virtualIPNet"`
ConnectionConfig *connectcfg.ConnectionConfig `json:"connectionConfig"`
ProxyURL string `json:"proxyURL"`
APIKey string `json:"apiKey"`
Debug bool `json:"debug"`
}
ConnectInvocationConfig is the config for locald as computed by `signadot local connect` when `signadot local connect` is called. This prevents racy behavior when the config file is edited, allows config to be computed by non-root user and used subsequently by root, and facilitates wrapping everything that needs to be passed in a json so we can evolve what needs to be passed without plumbing the command line
func (*ConnectInvocationConfig) GetLogName ¶ added in v0.5.0
func (ciConfig *ConnectInvocationConfig) GetLogName(isRootManager bool) string
func (*ConnectInvocationConfig) GetPIDfile ¶ added in v0.5.0
func (ciConfig *ConnectInvocationConfig) GetPIDfile(isRootManager bool) string
type ConnectInvocationUser ¶ added in v0.5.0
type ConnectInvocationUser struct {
UID int `json:"uid"`
GID int `json:"gid"`
UIDHome string `json:"uidHome"`
UIDPath string `json:"uidPath"`
Username string `json:"username"`
}
type ConnectWait ¶ added in v0.7.0
type ConnectWait int
const (
ConnectWaitConnect ConnectWait = iota
ConnectWaitSandboxes
ConnectWaitNone
)
func ParseConnectWait ¶ added in v0.7.0
func ParseConnectWait(v string) (ConnectWait, error)
type JobRunnerGroup ¶ added in v0.8.0
type JobRunnerGroup struct {
*API
}
type JobRunnerGroupApply ¶ added in v0.8.0
type JobRunnerGroupApply struct {
*JobRunnerGroup
// Flags
Filename string
TemplateVals TemplateVals
}
type JobRunnerGroupDelete ¶ added in v0.8.0
type JobRunnerGroupDelete struct {
*JobRunnerGroup
// Flags
Filename string
TemplateVals TemplateVals
}
type JobRunnerGroupGet ¶ added in v0.8.0
type JobRunnerGroupGet struct {
*JobRunnerGroup
}
type JobRunnerGroupList ¶ added in v0.8.0
type JobRunnerGroupList struct {
*JobRunnerGroup
}
type JobSubmit ¶ added in v0.8.0
type JobSubmit struct {
*Job
// Flags
Filename string
Attach bool
Timeout time.Duration
TemplateVals TemplateVals
Wait bool
}
type Local ¶ added in v0.5.0
type Local struct {
*API
ProxyURL string
// initialized from ~/.signadot/config.yaml
LocalConfig *config.Config
}
func (*Local) GetConnectionConfig ¶ added in v0.5.0
func (l *Local) GetConnectionConfig(cluster string) (*config.ConnectionConfig, error)
func (*Local) GetProxyURL ¶ added in v0.7.0
func (l *Local) GetProxyURL() (string, error)
func (*Local) InitLocalConfig ¶ added in v0.5.0
func (l *Local) InitLocalConfig() error
func (*Local) InitLocalProxyConfig ¶ added in v0.7.0
func (l *Local) InitLocalProxyConfig() error
type LocalConnect ¶ added in v0.5.0
type LocalConnect struct {
*Local
// Flags
Cluster string
Unprivileged bool
Wait ConnectWait
WaitTimeout time.Duration
// Hidden Flags
DumpCIConfig bool
PProfAddr string
}
type LocalDaemon ¶ added in v0.5.0
type LocalDaemon struct {
// config sent from `signadot local connect` in $SIGNADOT_LOCAL_CONNECT_CONFIG
ConnectInvocationConfig *ConnectInvocationConfig
// Flags
DaemonRun bool
RootManager bool
SandboxManager bool
// Hidden Flags
ConnectInvocationConfigFile string
PProfAddr string
}
func (*LocalDaemon) InitLocalDaemon ¶ added in v0.5.0
func (ld *LocalDaemon) InitLocalDaemon() error
type LocalDisconnect ¶ added in v0.5.0
type LocalDisconnect struct {
*Local
// Flags
CleanLocalSandboxes bool
}
type LocalProxy ¶ added in v0.7.0
type LocalProxy struct {
*Local
// Flags
Sandbox string
RouteGroup string
Cluster string
ProxyMappings []ProxyMapping
// Hidden Flags
PProfAddr string
}
type LocalStatus ¶ added in v0.5.0
type LocalStatus struct {
*Local
// Flags
Details bool
}
type OutputFormat ¶
type OutputFormat string
const (
OutputFormatDefault OutputFormat = ""
OutputFormatYAML OutputFormat = "yaml"
OutputFormatJSON OutputFormat = "json"
)
type ProxyMapping ¶ added in v0.7.0
type ProxyMapping struct {
TargetProto string
TargetAddr string
BindAddr string
}
type ResourcePlugin ¶ added in v0.4.0
type ResourcePlugin struct {
*API
}
type ResourcePluginApply ¶ added in v0.4.0
type ResourcePluginApply struct {
*ResourcePlugin
// Flags
Filename string
TemplateVals TemplateVals
}
type ResourcePluginDelete ¶ added in v0.4.0
type ResourcePluginDelete struct {
*ResourcePlugin
// Flags
Filename string
TemplateVals TemplateVals
}
type ResourcePluginGet ¶ added in v0.4.0
type ResourcePluginGet struct {
*ResourcePlugin
}
type ResourcePluginList ¶ added in v0.4.0
type ResourcePluginList struct {
*ResourcePlugin
}
type Root ¶
type Root struct {
// Config file values
DashboardURL *url.URL
// Flags
Debug bool
ConfigFile string
OutputFormat OutputFormat
}
func (*Root) JobDashboardUrl ¶ added in v0.8.0
func (c *Root) JobDashboardUrl(name string) *url.URL
func (*Root) RunnerGroupDashboardUrl ¶ added in v0.8.0
func (c *Root) RunnerGroupDashboardUrl(name string) *url.URL
func (*Root) SandboxDashboardURL ¶
func (c *Root) SandboxDashboardURL(name string) *url.URL
type RouteGroup ¶ added in v0.3.7
type RouteGroup struct {
*API
}
type RouteGroupApply ¶ added in v0.3.7
type RouteGroupApply struct {
*RouteGroup
// Flags
Filename string
Wait bool
WaitTimeout time.Duration
TemplateVals TemplateVals
}
type RouteGroupDelete ¶ added in v0.3.7
type RouteGroupDelete struct {
*RouteGroup
// Flags
Filename string
Wait bool
WaitTimeout time.Duration
TemplateVals TemplateVals
}
type RouteGroupGet ¶ added in v0.3.7
type RouteGroupGet struct {
*RouteGroup
}
type RouteGroupList ¶ added in v0.3.7
type RouteGroupList struct {
*RouteGroup
}
type SandboxApply ¶ added in v0.2.0
type SandboxApply struct {
*Sandbox
// Flags
Filename string
Wait bool
WaitTimeout time.Duration
TemplateVals TemplateVals
}
type SandboxDelete ¶
type SandboxDelete struct {
*Sandbox
// Flags
Filename string
Wait bool
WaitTimeout time.Duration
TemplateVals TemplateVals
Force bool
}
type SandboxGet ¶
type SandboxGet struct {
*Sandbox
}
type SandboxList ¶
type SandboxList struct {
*Sandbox
}
type TemplateVal ¶ added in v0.3.0
type TemplateVal struct {
Var, Val string
}
type TemplateVals ¶ added in v0.3.0
type TemplateVals []TemplateVal
type TestApply ¶ added in v0.8.2
type TestApply struct {
*Test
Filename string
TemplateVals TemplateVals
}
type TestDelete ¶ added in v0.8.2
type TestDelete struct {
*Test
Filename string
TemplateVals TemplateVals
}
type TestExecCancel ¶ added in v0.8.2
type TestExecCancel struct {
*TestExec
}
type TestExecGet ¶ added in v0.8.2
type TestExecGet struct {
*TestExec
}
type TestExecList ¶ added in v0.8.2
type TestExecList struct {
*TestExec
}