Documentation ¶
Index ¶
- func DefaultConfigDir() (string, error)
- func DefaultLocalConfigPath() (string, error)
- func DeleteLocalConfig(configPath string) error
- func ValidateLocalConfig(config LocalConfig) error
- func WriteLocalConfig(config LocalConfig, configPath string) error
- type Context
- type ContextRef
- type LocalConfig
- func (l *LocalConfig) GetServer(name string) (*Server, error)
- func (l *LocalConfig) GetUser(name string) (*User, error)
- func (l *LocalConfig) IsEmpty() bool
- func (l *LocalConfig) RemoveContext(serverName string) (string, bool)
- func (l *LocalConfig) RemoveServer(serverName string) bool
- func (l *LocalConfig) RemoveToken(serverName string) bool
- func (l *LocalConfig) RemoveUser(serverName string) bool
- func (l *LocalConfig) ResolveContext(name string) (*Context, error)
- func (l *LocalConfig) UpsertContext(context ContextRef)
- func (l *LocalConfig) UpsertServer(server Server)
- func (l *LocalConfig) UpsertUser(user User)
- type Server
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigDir ¶
DefaultConfigDir returns the local configuration path for settings such as cached authentication tokens.
func DefaultLocalConfigPath ¶
DefaultLocalConfigPath returns the local configuration path for settings such as cached authentication tokens.
func DeleteLocalConfig ¶ added in v1.1.0
func ValidateLocalConfig ¶
func ValidateLocalConfig(config LocalConfig) error
func WriteLocalConfig ¶
func WriteLocalConfig(config LocalConfig, configPath string) error
WriteLocalConfig writes a new local configuration file.
Types ¶
type ContextRef ¶
type ContextRef struct { Name string `json:"name"` Server string `json:"server"` User string `json:"user"` }
ContextRef is a reference to a Server and User for an API client
type LocalConfig ¶
type LocalConfig struct { CurrentContext string `json:"current-context"` Contexts []ContextRef `json:"contexts"` Servers []Server `json:"servers"` Users []User `json:"users"` }
LocalConfig is a local Argo CD config file
func ReadLocalConfig ¶
func ReadLocalConfig(path string) (*LocalConfig, error)
ReadLocalConfig loads up the local configuration file. Returns nil if config does not exist
func (*LocalConfig) IsEmpty ¶ added in v1.1.0
func (l *LocalConfig) IsEmpty() bool
func (*LocalConfig) RemoveContext ¶ added in v1.1.0
func (l *LocalConfig) RemoveContext(serverName string) (string, bool)
Returns true if context was removed successfully
func (*LocalConfig) RemoveServer ¶ added in v1.1.0
func (l *LocalConfig) RemoveServer(serverName string) bool
Returns true if server was removed successfully
func (*LocalConfig) RemoveToken ¶ added in v1.1.0
func (l *LocalConfig) RemoveToken(serverName string) bool
Returns true if user was removed successfully
func (*LocalConfig) RemoveUser ¶ added in v1.1.0
func (l *LocalConfig) RemoveUser(serverName string) bool
Returns true if user was removed successfully
func (*LocalConfig) ResolveContext ¶
func (l *LocalConfig) ResolveContext(name string) (*Context, error)
ResolveContext resolves the specified context. If unspecified, resolves the current context
func (*LocalConfig) UpsertContext ¶
func (l *LocalConfig) UpsertContext(context ContextRef)
func (*LocalConfig) UpsertServer ¶
func (l *LocalConfig) UpsertServer(server Server)
func (*LocalConfig) UpsertUser ¶
func (l *LocalConfig) UpsertUser(user User)
type Server ¶
type Server struct { // Server is the Argo CD server address Server string `json:"server"` // Insecure indicates to connect to the server over TLS insecurely Insecure bool `json:"insecure,omitempty"` // GRPCWeb indicates to connect to the server using gRPC Web protocol GRPCWeb bool `json:"grpc-web,omitempty"` // CACertificateAuthorityData is the base64 string of a PEM encoded certificate // TODO: not yet implemented CACertificateAuthorityData string `json:"certificate-authority-data,omitempty"` // PlainText indicates to connect with TLS disabled PlainText bool `json:"plain-text,omitempty"` }
Server contains Argo CD server information