Documentation
¶
Overview ¶
Package config provides the configuration for opampctl.
Index ¶
Constants ¶
const ( // AuthTypeGithub indicates that the user is authenticated using GitHub. AuthTypeGithub = "github" // AuthTypeBasic indicates that the user is authenticated using basic authentication. AuthTypeBasic = "basic" // AuthTypeManual indicates that the user is authenticated using a manual method (e.g., bearer token). AuthTypeManual = "manual" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶ added in v0.1.1
type Auth struct {
GithubAuth `json:",inline" mapstructure:",squash" yaml:",inline"`
BasicAuth `json:",inline" mapstructure:",squash" yaml:",inline"`
ManualAuth `json:",inline" mapstructure:",squash" yaml:",inline"`
Type string `json:"type" mapstructure:"type" yaml:"type"`
}
Auth represents the authentication method for a user in the opampctl configuration.
type BasicAuth ¶ added in v0.1.1
type BasicAuth struct {
Username string `json:"username,omitempty" mapstructure:"username,omitempty" yaml:"username,omitempty"`
Password string `json:"password,omitempty" mapstructure:"password,omitempty" yaml:"password,omitempty"`
}
BasicAuth represents the basic authentication method for a user in the opampctl configuration.
type Cluster ¶ added in v0.1.1
type Cluster struct {
Name string `json:"name" mapstructure:"name" yaml:"name"`
OpAMPCommander OpAMPCommander `json:"opampcommander" mapstructure:"opampcommander" yaml:"opampcommander"`
}
Cluster represents a cluster in the opampctl configuration.
type Context ¶ added in v0.1.1
type Context struct {
Name string `json:"name" mapstructure:"name" yaml:"name"`
Cluster string `json:"cluster" mapstructure:"cluster" yaml:"cluster"`
User string `json:"user" mapstructure:"user" yaml:"user"`
}
Context represents a context in the opampctl configuration.
type GithubAuth ¶ added in v0.1.1
type GithubAuth struct{}
GithubAuth represents the GitHub authentication method for a user in the opampctl configuration.
type GlobalConfig ¶
type GlobalConfig struct {
// Debugging Configuration
// This configuration is not serialized to the config file.
Runtime `json:"-" mapstructure:"-" yaml:"-"`
// CacheDir is the directory where cached files are stored.
CacheDir string `json:"cacheDir" mapstructure:"cacheDir" yaml:"cacheDir"`
CurrentContext string `json:"currentContext" mapstructure:"currentContext" yaml:"currentContext"`
Contexts []Context `json:"contexts" mapstructure:"contexts" yaml:"contexts"`
Users []User `json:"users" mapstructure:"users" yaml:"users"`
Clusters []Cluster `json:"clusters" mapstructure:"clusters" yaml:"clusters"`
}
GlobalConfig contains the global configuration for opampctl.
func NewDefaultGlobalConfig ¶ added in v0.1.1
func NewDefaultGlobalConfig(homedir string) *GlobalConfig
NewDefaultGlobalConfig creates a new GlobalConfig with default values.
type ManualAuth ¶ added in v0.1.1
type ManualAuth struct {
BearerToken string `json:"bearerToken,omitempty" mapstructure:"bearerToken,omitempty" yaml:"bearerToken,omitempty"`
}
ManualAuth represents the manual authentication method for a user in the opampctl configuration.
type OpAMPCommander ¶ added in v0.1.1
type OpAMPCommander struct {
Endpoint string `json:"endpoint" mapstructure:"endpoint" yaml:"endpoint"`
}
OpAMPCommander represents the OpAMP Commander configuration in the opampctl configuration.
type Runtime ¶ added in v0.1.10
type Runtime struct {
// ConfigFilename is the path to the configuration file.
ConfigFilename string `json:"-" mapstructure:"-" yaml:"-"`
// Output is the output writer for the command.
Output io.Writer `json:"-" mapstructure:"-" yaml:"-"`
// Log
Log Log `json:"-" mapstructure:"-" yaml:"-"`
}
Runtime contains runtime configuration that is not serialized to the config file. It's helper to run the command.