config

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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

func LoadConfigFromFile(configFile string) (*Config, error)

LoadConfig loads the kube-bind configuration from file

func NewConfig

func NewConfig(configFile string) *Config

NewConfig creates a new empty configuration

func (*Config) AddServerWithCluster

func (c *Config) AddServerWithCluster(serverURL, clusterID string, server *Server)

AddServerWithCluster adds or updates server configuration with cluster ID

func (*Config) FindServersByURL

func (c *Config) FindServersByURL(serverURL string) map[string]*Server

FindServersByURL finds all servers for a given URL (across all clusters)

func (*Config) Get

func (c *Config) Get(serverURL, clusterID string) (*Server, bool)

func (*Config) GetConfigPath

func (c *Config) GetConfigPath() (string, error)

GetConfigPath returns the path to the kube-bind config file

func (*Config) GetCurrentServer

func (c *Config) GetCurrentServer() (*Server, string, error)

GetCurrentServer returns the currently active server configuration.

func (*Config) RemoveServer

func (c *Config) RemoveServer(name, cluster string)

RemoveServer removes a server from the configuration

func (*Config) SaveConfig

func (c *Config) SaveConfig() error

SaveConfig saves the kube-bind configuration to file

func (*Config) SetCurrentServer

func (c *Config) SetCurrentServer(serverName, cluster string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL