Documentation ¶
Overview ¶
Package cfenv provides information about the current app deployed on Cloud Foundry, including any bound service(s).
Index ¶
- func CurrentEnv() map[string]string
- func Env(env []string) map[string]string
- func IsRunningOnCF() bool
- type App
- type Limits
- type Service
- type Services
- func (s *Services) WithLabel(label string) ([]Service, error)
- func (s *Services) WithName(name string) (*Service, error)
- func (s *Services) WithNameUsingPattern(namePattern string) ([]Service, error)
- func (s *Services) WithTag(tag string) ([]Service, error)
- func (s *Services) WithTagUsingPattern(tagPattern string) ([]Service, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentEnv ¶
CurrentEnv translates the current environment to a map[string]string.
func IsRunningOnCF ¶ added in v1.17.0
func IsRunningOnCF() bool
IsRunningOnCF returns true if the current environment is Cloud Foundry and false if it is not Cloud Foundry
Types ¶
type App ¶
type App struct { ID string `json:"-"` // DEPRECATED id of the instance InstanceID string `json:"instance_id"` // id of the instance AppID string `json:"application_id"` // id of the application Index int `json:"instance_index"` // index of the app Name string `json:"name"` // name of the app Host string `json:"host"` // host of the app Port int `json:"port"` // port of the app Version string `json:"version"` // version of the app ApplicationURIs []string `json:"application_uris"` // application uri of the app SpaceID string `json:"space_id"` // id of the space SpaceName string `json:"space_name"` // name of the space Home string // root folder for the deployed app MemoryLimit string // maximum amount of memory that each instance of the application can consume WorkingDir string // present working directory, where the buildpack that processed the application ran TempDir string // directory location where temporary and staging files are stored User string // user account under which the DEA runs Services Services // services bound to the app CFAPI string `json:"cf_api"` // URL for the Cloud Foundry API endpoint Limits *Limits `json:"limits"` // limits imposed on this process }
An App holds information about the current app running on Cloud Foundry
type Service ¶
type Service struct { Name string // name of the service Label string // label of the service Tags []string // tags for the service Plan string // plan of the service Credentials map[string]interface{} // credentials for the service VolumeMounts []map[string]string `mapstructure:"volume_mounts"` // volume mount info as provided by the nfsbroker }
Service describes a bound service. For bindable services Cloud Foundry will add connection details to the VCAP_SERVICES environment variable when you restart your application, after binding a service instance to your application.
The results are returned as a JSON document that contains an object for each service for which one or more instances are bound to the application. The service object contains a child object for each service instance of that service that is bound to the application.
type Services ¶
Services is an association of service labels to a slice of services with that label.
func (*Services) WithNameUsingPattern ¶
WithName finds the service with a name pattern.