https://github.com/cloudfoundry-community/go-cfenv
Go Cloud Foundry Environment Parsing Package
https://github.com/cloudfoundry-community/go-cfenv
Last synced: 6 months ago
JSON representation
Go Cloud Foundry Environment Parsing Package
- Host: GitHub
- URL: https://github.com/cloudfoundry-community/go-cfenv
- Owner: cloudfoundry-community
- License: apache-2.0
- Created: 2014-02-13T01:32:38.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-03-24T19:53:08.000Z (over 7 years ago)
- Last Synced: 2025-10-21T17:42:55.509Z (9 months ago)
- Language: Go
- Homepage:
- Size: 191 KB
- Stars: 53
- Watchers: 15
- Forks: 19
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go CF Environment Package [](https://travis-ci.org/cloudfoundry-community/go-cfenv)
### Overview
[](https://godoc.org/github.com/cloudfoundry-community/go-cfenv)
`cfenv` is a package to assist you in writing Go apps that run on [Cloud Foundry](http://cloudfoundry.org). It provides convenience functions and structures that map to Cloud Foundry environment variable primitives (http://docs.cloudfoundry.org/devguide/deploy-apps/environment-variable.html).
### Usage
`go get github.com/cloudfoundry-community/go-cfenv`
```go
package main
import (
"github.com/cloudfoundry-community/go-cfenv"
)
func main() {
appEnv, _ := cfenv.Current()
fmt.Println("ID:", appEnv.ID)
fmt.Println("Index:", appEnv.Index)
fmt.Println("Name:", appEnv.Name)
fmt.Println("Host:", appEnv.Host)
fmt.Println("Port:", appEnv.Port)
fmt.Println("Version:", appEnv.Version)
fmt.Println("Home:", appEnv.Home)
fmt.Println("MemoryLimit:", appEnv.MemoryLimit)
fmt.Println("WorkingDir:", appEnv.WorkingDir)
fmt.Println("TempDir:", appEnv.TempDir)
fmt.Println("User:", appEnv.User)
fmt.Println("Services:", appEnv.Services)
}
```
### Contributing
Pull requests welcomed.