Documentation
¶
Index ¶
- func AddConnectionToList(httpClient utils.HTTPClient, c *cli.Context) (*Connection, *ConError)
- func GetAllConnections() ([]Connection, *ConError)
- func GetConnectionByID(conID string) (*Connection, *ConError)
- func GetConnectionConfigDir() string
- func GetConnectionConfigFilename() string
- func GetConnectionsConfig() (*ConnectionConfig, *ConError)
- func UpdateExistingConnection(httpClient utils.HTTPClient, c *cli.Context) (*Connection, *ConError)
- type ConError
- type Connection
- type ConnectionConfig
- type ConnectionConfigV0
- type ConnectionConfigV1
- type ConnectionV0
- type ConnectionV1
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConnectionToList ¶
func AddConnectionToList(httpClient utils.HTTPClient, c *cli.Context) (*Connection, *ConError)
AddConnectionToList : validates then adds a new connection to the connection config
func GetAllConnections ¶
func GetAllConnections() ([]Connection, *ConError)
GetAllConnections : Retrieve all saved connections
func GetConnectionByID ¶
func GetConnectionByID(conID string) (*Connection, *ConError)
GetConnectionByID : retrieve a single connection with matching ID
func GetConnectionConfigDir ¶
func GetConnectionConfigDir() string
GetConnectionConfigDir : get path to the connections config directory
func GetConnectionConfigFilename ¶
func GetConnectionConfigFilename() string
GetConnectionConfigFilename : get full file path of connections file
func GetConnectionsConfig ¶
func GetConnectionsConfig() (*ConnectionConfig, *ConError)
GetConnectionsConfig : Retrieves and returns the entire Connection configuration contents
func UpdateExistingConnection ¶
func UpdateExistingConnection(httpClient utils.HTTPClient, c *cli.Context) (*Connection, *ConError)
UpdateExistingConnection : Update an existing connection
Types ¶
type ConError ¶
ConError : Connection package errors
func InitConfigFileIfRequired ¶
func InitConfigFileIfRequired() *ConError
InitConfigFileIfRequired : Check the config file exist, if it does not then create a new default configuration
func RemoveConnectionFromList ¶
RemoveConnectionFromList : Removes the stored entry
func ResetConnectionsFile ¶
func ResetConnectionsFile() *ConError
ResetConnectionsFile : Creates a new / overwrites connection config file with a default single local Codewind connection
type Connection ¶
type Connection struct {
ID string `json:"id"`
Label string `json:"label"`
// Deprecated: Do not use URL when calling PFE APIs. Use config.PFEOriginFromConnection() which is cloud aware
URL string `json:"url"`
AuthURL string `json:"auth"`
Realm string `json:"realm"`
ClientID string `json:"clientid"`
Username string `json:"username"`
}
Connection entry
type ConnectionConfig ¶
type ConnectionConfig struct {
SchemaVersion int `json:"schemaversion"`
Connections []Connection `json:"connections"`
}
ConnectionConfig state and possible connections
type ConnectionConfigV0 ¶
type ConnectionConfigV0 struct {
Connections []ConnectionV0 `json:"connections"`
}
ConnectionConfigV0 : ConnectionsConfig Schema Version 0
type ConnectionConfigV1 ¶
type ConnectionConfigV1 struct {
SchemaVersion int `json:"schemaversion"`
Connections []ConnectionV1 `json:"connections"`
}
ConnectionConfigV1 : Connections Schema Version 1
type ConnectionV0 ¶
type ConnectionV0 struct {
Name string `json:"name"`
Label string `json:"label"`
URL string `json:"url"`
AuthURL string `json:"auth"`
Realm string `json:"realm"`
ClientID string `json:"client_id"`
}
ConnectionV0 : Connections Schema Version 0