cloudfoundry

package
v1.230.4 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVarsFileOptions

func GetVarsFileOptions(varsFiles []string) ([]string, error)

GetVarsFileOptions Returns a string array containing valid var file options, e.g.: --vars myVars.yml The options array contains all vars files which could be resolved in the file system. In case some vars files cannot be found, the missing files are reported via the error which is in this case a VarsFilesNotFoundError. In that case the options array contains nevertheless the options for all existing files.

func GetVarsOptions

func GetVarsOptions(vars []string) ([]string, error)

GetVarsOptions Returns the vars as valid var option string slice InvalidVars are reported via error.

Types

type AuthenticationUtils

type AuthenticationUtils interface {
	Login(options LoginOptions) error
	Logout() error
}

AuthenticationUtils - interface for cloud foundry login and logout

type CFUtils

type CFUtils struct {
	// In order to avoid clashes between parallel workflows requiring cf login/logout
	// this instance of command.ExecRunner can be configured accordingly by settings the
	// environment variables CF_HOME to distict directories.
	// In order to ensure plugins installed to the cf cli are found environment variables
	// CF_PLUGIN_HOME can be set accordingly.
	Exec command.ExecRunner
	// contains filtered or unexported fields
}

CFUtils ...

func (*CFUtils) Login

func (cf *CFUtils) Login(options LoginOptions) error

Login logs user in to Cloud Foundry via cf cli. Checks if user is logged in first, if not perform 'cf login' command with appropriate parameters

func (*CFUtils) LoginCheck

func (cf *CFUtils) LoginCheck(options LoginOptions) (bool, error)

LoginCheck checks if user is logged in to Cloud Foundry with the receiver provided to the function call.

func (*CFUtils) Logout

func (cf *CFUtils) Logout() error

Logout logs User out of Cloud Foundry Logout can be perforned via 'cf logout' command regardless if user is logged in or not

func (*CFUtils) ReadServiceKey

func (cf *CFUtils) ReadServiceKey(options ServiceKeyOptions) (string, error)

ReadServiceKey reads a cloud foundry service key based on provided service instance and service key name parameters

type CfUtilsMock

type CfUtilsMock struct {
	LoginError  error
	LogoutError error
}

CfUtilsMock - mock for CfUtils

func (*CfUtilsMock) Cleanup

func (cf *CfUtilsMock) Cleanup()

Cleanup for CfUtilsMock

func (*CfUtilsMock) Login

func (cf *CfUtilsMock) Login(options LoginOptions) error

Login mock implementation

func (*CfUtilsMock) Logout

func (cf *CfUtilsMock) Logout() error

Logout mock implementation

type LoginOptions

type LoginOptions struct {
	CfAPIEndpoint string
	CfOrg         string
	CfSpace       string
	Username      string
	Password      string
	CfLoginOpts   []string
}

LoginOptions for logging in to CF

type Manifest

type Manifest interface {
	GetFileName() string
	GetAppName(index int) (string, error)
	ApplicationHasProperty(index int, name string) (bool, error)
	GetApplicationProperty(index int, name string) (interface{}, error)
	Transform() error
	IsModified() bool
	GetApplications() ([]map[string]interface{}, error)
	WriteManifest() error
}

Manifest ...

func ReadManifest

func ReadManifest(name string) (Manifest, error)

ReadManifest Reads the manifest denoted by 'name'

type ServiceKeyOptions

type ServiceKeyOptions struct {
	CfAPIEndpoint     string
	CfOrg             string
	CfSpace           string
	CfServiceInstance string
	CfServiceKeyName  string
	Username          string
	Password          string
}

ServiceKeyOptions for reading CF Service Key

type VarsFilesNotFoundError

type VarsFilesNotFoundError struct {
	Message      string
	MissingFiles []string
}

VarsFilesNotFoundError ...

func (*VarsFilesNotFoundError) Error

func (e *VarsFilesNotFoundError) Error() string

Jump to

Keyboard shortcuts

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