Documentation ¶
Index ¶
Constants ¶
View Source
const ( // RecommendedHomeDir is the default name for the osprey home directory. RecommendedHomeDir = ".osprey" // RecommendedFileName is the default name for the osprey config file. RecommendedFileName = "config" )
Variables ¶
View Source
var ( // HomeDir is the user's home directory. HomeDir = homeDir() // RecommendedOspreyHomeDir is the default full path for the osprey home. RecommendedOspreyHomeDir = path.Join(HomeDir, RecommendedHomeDir) // RecommendedOspreyConfigFile is the default full path for the osprey config file. RecommendedOspreyConfigFile = path.Join(RecommendedOspreyHomeDir, RecommendedFileName) )
Functions ¶
func SaveConfig ¶
SaveConfig serializes the osprey config to the specified path.
Types ¶
type Client ¶
type Client interface { // GetAccessToken returns an access token that is required to authenticate user access against a kubernetes cluster GetAccessToken(*LoginCredentials) (*kubeconfig.TokenInfo, error) }
Client is used to authenticate and generate the configuration
type Config ¶
type Config struct { // CertificateAuthority is the path to a cert file for the certificate authority. // +optional CertificateAuthority string `yaml:"certificate-authority,omitempty"` // CertificateAuthorityData is base64-encoded CA cert data. // This will override any cert file specified in CertificateAuthority. // +optional CertificateAuthorityData string `yaml:"certificate-authority-data,omitempty"` // Kubeconfig specifies the path to read/write the kubeconfig file // +optional Kubeconfig string `yaml:"kubeconfig,omitempty"` // Ospreys is a map of referenceable names to osprey configs Targets map[string]*Osprey `yaml:"targets"` }
Config holds the information needed to connect to remote osprey servers as a given user
func LoadConfig ¶
LoadConfig reads an osprey Config from the specified path.
type LoginCredentials ¶
type LoginCredentials struct { // Username username of user intending to login Username string // Password the password for user Password string }
LoginCredentials represents user credentials
func GetCredentials ¶
func GetCredentials() (*LoginCredentials, error)
GetCredentials loads the credentials from the terminal or stdin.
type Osprey ¶
type Osprey struct { // Server is the address of the osprey server (hostname:port). Server string `yaml:"server"` // CertificateAuthority is the path to a cert file for the certificate authority. // +optional CertificateAuthority string `yaml:"certificate-authority,omitempty"` // CertificateAuthorityData is base64-encoded CA cert data. // This will override any cert file specified in CertificateAuthority. // +optional CertificateAuthorityData string `yaml:"certificate-authority-data,omitempty"` Aliases []string `yaml:"aliases,omitempty"` }
Osprey contains information about how to communicate with an osprey server
Click to show internal directories.
Click to hide internal directories.