helpers

package
v6.30.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GUIDRegex             = "[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}"
	ISO8601Regex          = "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{1,3}[+-]\\d{4}"
	UserFriendlyDateRegex = "[A-Z][a-z]{2} \\d{2} [A-Z][a-z]{2} \\d{2}:\\d{2}:\\d{2} [A-Z]+ \\d{4}"
)
View Source
const (
	DefaultMemoryLimit = "256M"
	DefaultDiskLimit   = "1G"
)

Variables

This section is empty.

Functions

func AddOrReplaceEnvironment

func AddOrReplaceEnvironment(env []string, newEnvName string, newEnvVal string) []string

func AppGUID

func AppGUID(appName string) string

AppGUID returns the GUID for an app in the currently targeted space.

func BindRouteToApplication

func BindRouteToApplication(app string, domain string, host string, path string)

func BuildConfigurablePlugin

func BuildConfigurablePlugin(pluginType string, name string, version string, pluginCommands []PluginCommand) string

func CF

func CF(args ...string) *Session

func CFWithEnv

func CFWithEnv(envVars map[string]string, args ...string) *Session

func CFWithStdin

func CFWithStdin(stdin io.Reader, args ...string) *Session

func ClearTarget

func ClearTarget()

func ConvertPathToRegularExpression

func ConvertPathToRegularExpression(path string) string

ConvertPathToRegularExpression converts a windows file path into a string which may be embedded in a ginkgo-compatible regular expression.

func CreateOrg

func CreateOrg(org string)

func CreateOrgAndSpace

func CreateOrgAndSpace(org string, space string)

func CreateSpace

func CreateSpace(space string)

func CustomCF

func CustomCF(cfEnv CFEnv, args ...string) *Session

func DestroyHomeDir

func DestroyHomeDir(homeDir string)

func DomainName

func DomainName(prefix ...string) string

func EnableDockerSupport

func EnableDockerSupport()

func GetAPI

func GetAPI() string

func GetAppGuid

func GetAppGuid(appName string) string

func GetCredentials

func GetCredentials() (string, string)

func GetIsolationSegmentGUID

func GetIsolationSegmentGUID(name string) string

func GetOrgGUID

func GetOrgGUID(orgName string) string

func GetSpaceGUID

func GetSpaceGUID(spaceName string) string

func InstallConfigurablePlugin

func InstallConfigurablePlugin(name string, version string, pluginCommands []PluginCommand)

func InstallConfigurablePluginFailsUninstall

func InstallConfigurablePluginFailsUninstall(name string, version string, pluginCommands []PluginCommand)

func InvalidAccessToken

func InvalidAccessToken() string

func LoginCF

func LoginCF() string

func LogoutCF

func LogoutCF()

func NewAppName

func NewAppName() string

func NewIsolationSegmentName

func NewIsolationSegmentName(infix ...string) string

func NewOrgName

func NewOrgName() string

func NewPassword

func NewPassword() string

func NewPluginRepositoryServer

func NewPluginRepositoryServer(pluginRepo PluginRepository) *Server

func NewPluginRepositoryTLSServer

func NewPluginRepositoryTLSServer(pluginRepo PluginRepository) *Server

func NewSecurityGroupName

func NewSecurityGroupName(infix ...string) string

func NewSpaceName

func NewSpaceName() string

func NewUsername

func NewUsername() string

func PluginPlatform

func PluginPlatform() string

func PrefixedRandomName

func PrefixedRandomName(namePrefix string) string

func QuickDeleteOrg

func QuickDeleteOrg(orgName string)

func QuickDeleteSpace

func QuickDeleteSpace(spaceName string)

func QuotaName

func QuotaName(name ...string) string

func RandomName

func RandomName() string

func RunIfExperimental

func RunIfExperimental(msg string)

RunIfExperimental is for tests that should be skipped if CF_CLI_EXPERIMENTAL is set to false.

func SetAPI

func SetAPI() (string, string)

func SetConfig

func SetConfig(cb func(conf *configv3.Config))

func SetConfigContent

func SetConfigContent(dir string, rawConfig string)

func SetHomeDir

func SetHomeDir() string

func SetupReadOnlyOrgAndSpace

func SetupReadOnlyOrgAndSpace() (string, string)

func Sha1Sum

func Sha1Sum(path string) string

Calculate the SHA1 sum of a file.

func SkipIfExperimental

func SkipIfExperimental(msg string)

SkipIfExperimental is for tests that should be skipped if CF_CLI_EXPERIMENTAL is set to true.

func TargetOrg

func TargetOrg(org string)

func TargetOrgAndSpace

func TargetOrgAndSpace(org string, space string)

func TurnOffColors

func TurnOffColors()

func UnbindRouteToApplication

func UnbindRouteToApplication(app string, domain string, host string, path string)

func UnsetAPI

func UnsetAPI()

func WithBananaPantsApp

func WithBananaPantsApp(f func(dir string))

WithBananaPantsApp creates a simple application to use with your CLI command (typically CF Push). When pushing, be aware of specifying '-b staticfile_buildpack" so that your app will correctly start up with the proper buildpack.

func WithHelloWorldApp

func WithHelloWorldApp(f func(dir string))

WithHelloWorldApp creates a simple application to use with your CLI command (typically CF Push). When pushing, be aware of specifying '-b staticfile_buildpack" so that your app will correctly start up with the proper buildpack.

func WithMultiBuildpackApp

func WithMultiBuildpackApp(f func(dir string))

func WithProcfileApp

func WithProcfileApp(f func(dir string))

WithProcfileApp creates an application to use with your CLI command that contains Procfile defining web and worker processes.

func WriteManifest

func WriteManifest(path string, manifest map[string]interface{})

func Zipit

func Zipit(source, target, prefix string) error

Thanks to Svett Ralchev http://blog.ralch.com/tutorial/golang-working-with-zip/ Zipit zips the source into a .zip file in the target dir

Types

type AppInstanceRow

type AppInstanceRow struct {
	Index  string
	State  string
	Since  string
	CPU    string
	Memory string
	Disk   string
}

type AppProcessTable

type AppProcessTable struct {
	Title     string
	Instances []AppInstanceRow
}

type AppTable

type AppTable struct {
	Processes []AppProcessTable
}

func ParseV3AppTable

func ParseV3AppTable(input []byte) AppTable

type Assets

type Assets struct {
	ServiceBroker string
}

func NewAssets

func NewAssets() Assets

type Binary

type Binary struct {
	Checksum string `json:"checksum"`
	Platform string `json:"platform"`
	URL      string `json:"url"`
}

type CFEnv

type CFEnv struct {
	WorkingDirectory string
	EnvVars          map[string]string
	// contains filtered or unexported fields
}

type Domain

type Domain struct {
	Org  string
	Name string
}

func NewDomain

func NewDomain(org string, name string) Domain

func (Domain) Create

func (d Domain) Create()

func (Domain) CreateShared

func (d Domain) CreateShared()

func (Domain) CreateWithRouterGroup

func (d Domain) CreateWithRouterGroup(routerGroup string)

func (Domain) Delete

func (d Domain) Delete()

func (Domain) Share

func (d Domain) Share()

type Plan

type Plan struct {
	Name string `json:"name"`
	ID   string `json:"id"`
}

type Plugin

type Plugin struct {
	Name     string   `json:"name"`
	Version  string   `json:"version"`
	Binaries []Binary `json:"binaries"`
}

type PluginCommand

type PluginCommand struct {
	Name  string
	Alias string
	Help  string
}

type PluginRepository

type PluginRepository struct {
	Plugins []Plugin `json:"plugins"`
}

type PluginRepositoryServerWithPlugin

type PluginRepositoryServerWithPlugin struct {
	// contains filtered or unexported fields
}

func NewPluginRepositoryServerWithPlugin

func NewPluginRepositoryServerWithPlugin(pluginName string, version string, platform string, shouldCalculateChecksum bool) *PluginRepositoryServerWithPlugin

func (*PluginRepositoryServerWithPlugin) Cleanup

func (pluginRepoServer *PluginRepositoryServerWithPlugin) Cleanup()

func (*PluginRepositoryServerWithPlugin) Init

func (pluginRepoServer *PluginRepositoryServerWithPlugin) Init(pluginName string, version string, platform string, shouldCalculateChecksum bool)

func (*PluginRepositoryServerWithPlugin) PluginSize

func (pluginRepoServer *PluginRepositoryServerWithPlugin) PluginSize() int64

func (*PluginRepositoryServerWithPlugin) URL

func (pluginRepoServer *PluginRepositoryServerWithPlugin) URL() string

type Route

type Route struct {
	Space  string
	Host   string
	Domain string
	Path   string
}

func NewRoute

func NewRoute(space string, domain string, hostname string, path string) Route

func (Route) Create

func (r Route) Create()

func (Route) Delete

func (r Route) Delete()

type SecurityGroup

type SecurityGroup struct {
	Name        string `json:"-"`
	Protocol    string `json:"protocol"`
	Destination string `json:"destination"`
	Ports       string `json:"ports"`
	Description string `json:"description"`
}

func NewSecurityGroup

func NewSecurityGroup(name string, protocol string, destination string, ports string, description string) SecurityGroup

func (SecurityGroup) Create

func (s SecurityGroup) Create()

type ServiceBroker

type ServiceBroker struct {
	Name       string
	Path       string
	AppsDomain string
	Service    struct {
		Name            string `json:"name"`
		ID              string `json:"id"`
		DashboardClient struct {
			ID          string `json:"id"`
			Secret      string `json:"secret"`
			RedirectUri string `json:"redirect_uri"`
		}
	}
	SyncPlans  []Plan
	AsyncPlans []Plan
}

func NewServiceBroker

func NewServiceBroker(name string, path string, appsDomain string, serviceName string, planName string) ServiceBroker

func (ServiceBroker) Configure

func (b ServiceBroker) Configure()

func (ServiceBroker) Create

func (b ServiceBroker) Create()

func (ServiceBroker) Delete

func (b ServiceBroker) Delete()

func (ServiceBroker) Destroy

func (b ServiceBroker) Destroy()

func (ServiceBroker) Push

func (b ServiceBroker) Push()

func (ServiceBroker) ToJSON

func (b ServiceBroker) ToJSON() string

Jump to

Keyboard shortcuts

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