Documentation
¶
Index ¶
- func GetDefaultConfigFilePath() string
- type Config
- func (c *Config) AddServerWithCluster(serverURL, clusterID string, server *Server)
- func (c *Config) FindServersByURL(serverURL string) map[string]*Server
- func (c *Config) Get(serverURL, clusterID string) (*Server, bool)
- func (c *Config) GetConfigPath() (string, error)
- func (c *Config) GetCurrentServer() (*Server, string, error)
- func (c *Config) RemoveServer(name, cluster string)
- func (c *Config) SaveConfig() error
- func (c *Config) SetCurrentServer(serverName, cluster string) error
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultConfigFilePath ¶
func GetDefaultConfigFilePath() string
GetDefaultConfigFilePath returns the default path to the kube-bind config file
Types ¶
type Config ¶
type Config struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Servers map[string]*Server `json:"servers,omitempty"`
Current string `json:"current,omitempty"`
// contains filtered or unexported fields
}
Config represents the kube-bind CLI configuration
func LoadConfigFromFile ¶
LoadConfig loads the kube-bind configuration from file
func (*Config) AddServerWithCluster ¶
AddServerWithCluster adds or updates server configuration with cluster ID
func (*Config) FindServersByURL ¶
FindServersByURL finds all servers for a given URL (across all clusters)
func (*Config) GetConfigPath ¶
GetConfigPath returns the path to the kube-bind config file
func (*Config) GetCurrentServer ¶
GetCurrentServer returns the currently active server configuration.
func (*Config) RemoveServer ¶
RemoveServer removes a server from the configuration
func (*Config) SaveConfig ¶
SaveConfig saves the kube-bind configuration to file
func (*Config) SetCurrentServer ¶
SetCurrentServer sets the current active server
type Server ¶
type Server struct {
URL string `json:"url"`
Cluster string `json:"cluster,omitempty"`
AccessToken string `json:"accessToken,omitempty"`
TokenType string `json:"tokenType,omitempty"`
ExpiresAt time.Time `json:"expiresAt,omitempty"`
Username string `json:"username,omitempty"`
}
Server represents authentication details for a kube-bind server