connections

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: EPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

type ConError struct {
	Op   string
	Err  error
	Desc string
}

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

func RemoveConnectionFromList(c *cli.Context) *ConError

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

func (*ConError) Error

func (se *ConError) Error() string

ConError : Error formatted in JSON containing an errorOp and a description from either a fault condition in the CLI, or an error payload from a REST request

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

type ConnectionV1

type ConnectionV1 struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	URL      string `json:"url"`
	AuthURL  string `json:"auth"`
	Realm    string `json:"realm"`
	ClientID string `json:"client_id"`
}

ConnectionV1 : Connections Schema Version 1

type Result

type Result struct {
	Status        string `json:"status"`
	StatusMessage string `json:"status_message"`
}

Result : status message

Jump to

Keyboard shortcuts

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