helper

package
v0.0.0-...-a87237c Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FiveSecondTimeout   = 5 * time.Second
	ThirtyMinuteTimeout = 30 * time.Minute
)
View Source
const COMMAND_TIMEOUT = 5 * time.Minute
View Source
const RETRY_LIMIT = 5

Variables

This section is empty.

Functions

func AwaitServiceAvailable

func AwaitServiceAvailable(serviceName string)

Keeps polling `cf service <service-name>` until service is created or updated. For on-demand offerings the operation of creating or updating a service instance is async, which means that cf-cli immediately return `exit 0` while the operation is been handled in the background by On-Demand broker. This should be fast for multitenant offering, given that it's a sync operation.

func AwaitServiceDeletion

func AwaitServiceDeletion(serviceName string)

Keeps polling `cf services` until service is no longer found in the services list. For On-Demand offerings this operation is async and might take longer.

func BindSecurityGroup

func BindSecurityGroup(securityGroupName, orgName, spaceName string)

func Cf

func Cf(args ...string) *gexec.Session

func CfWithBufferedOutput

func CfWithBufferedOutput(args ...string) (s *gexec.Session)

CfWithBufferedOutput runs cf with given args. It has a command timeout of COMMAND_TIMEOUT minutes, and retries failed commands up to RETRY_LIMIT. The output of the command is not sent to the standard output. Output of the command can be accessed via the returned Session.

func CfWithTimeout

func CfWithTimeout(timeout time.Duration, args ...string) *gexec.Session

func CreateSecurityGroup

func CreateSecurityGroup(securityGroupName string)

func CreateService

func CreateService(serviceOffering, servicePlan, serviceName, params string)

func CreateServiceKey

func CreateServiceKey(serviceName, keyName string)

func DeleteApp

func DeleteApp(appName string)

func DeleteSecurityGroup

func DeleteSecurityGroup(securityGroupName string)

func DeleteService

func DeleteService(serviceName string)

func DeleteServiceKey

func DeleteServiceKey(serviceName, keyName string)

func LookupAppURL

func LookupAppURL(appName string) string

func PrintAppLogs

func PrintAppLogs(appName string)

func PushAndBindApp

func PushAndBindApp(appName, serviceName, testAppPath string) string

func ReceiveMessage

func ReceiveMessage(testAppURL, queueName string) string

func SendMessage

func SendMessage(testAppURL, queueName, message string)

func UnbindService

func UnbindService(appName, serviceName string)

func UpdateService

func UpdateService(serviceName, params string)

Types

type ServiceKey

type ServiceKey struct {
	DashboardUrl string                    `json:"dashboard_url"`
	Username     string                    `json:"username"`
	Password     string                    `json:"password"`
	Hostname     string                    `json:"hostname"`
	Hostnames    []string                  `json:"hostnames"`
	HttpApiUri   string                    `json:"http_api_uri"`
	HttpApiUris  []string                  `json:"http_api_uris"`
	URI          string                    `json:"uri"`
	URIs         []string                  `json:"uris"`
	VHOST        string                    `json:"vhost"`
	SSL          bool                      `json:"ssl"`
	Protocols    map[string]map[string]any `json:"protocols"`
}

func GetServiceKey

func GetServiceKey(serviceName, keyName string) ServiceKey

Jump to

Keyboard shortcuts

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