Documentation
¶
Overview ¶
Package config provides configuration management for gitcode-cli
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig interface {
// ActiveToken returns the active token for a host
ActiveToken(hostname string) (string, string)
// HasActiveToken checks if a token exists for a host
HasActiveToken(hostname string) bool
// ActiveUser returns the active user for a host
ActiveUser(hostname string) (string, error)
// Hosts returns all configured hosts
Hosts() []string
// DefaultHost returns the default host
DefaultHost() (string, string)
// Login creates or updates authentication for a host
Login(hostname, username, token, gitProtocol string, secureStorage bool) (bool, error)
// Logout removes authentication for a host
Logout(hostname, username string) error
// SwitchUser switches the active user for a host
SwitchUser(hostname, user string) error
}
AuthConfig interface defines authentication operations
type Config ¶
type Config interface {
// Get retrieves a configuration value
Get(host, key string) (string, error)
// Set stores a configuration value
Set(host, key, value string) error
// GitProtocol returns the preferred git protocol
GitProtocol(host string) ConfigEntry
// Editor returns the preferred editor
Editor(host string) ConfigEntry
// Browser returns the preferred browser
Browser(host string) ConfigEntry
// Pager returns the preferred pager
Pager(host string) ConfigEntry
// Authentication returns authentication configuration
Authentication() AuthConfig
// Write persists the configuration
Write() error
}
Config interface defines configuration operations
Source Files
¶
- auth_config.go
- config.go
Click to show internal directories.
Click to hide internal directories.