Skip to content

cloudfoundry-community/go-cfenvnested

Repository files navigation

Go Cloud Foundry Environment Package (cfenvnested)

NOTE: this is a fork of https://github.com/cloudfoundry-community/go-cfenv that allows service credentials with nested structures. One day we will figure out how to blend the two together.

Overview

GoDoc

cfenvnested is a package to assist you in writing Go apps that run on Cloud Foundry. It provides convenience functions and structures that map to Cloud Foundry environment variable primitives (http://docs.cloudfoundry.com/docs/using/deploying-apps/environment-variable.html).

Build Status

  • Build Status - Master Master
  • Build Status - Develop Develop

Usage

go get github.com/cloudfoundry-community/go-cfenvnested

package main

import (
	"github.com/cloudfoundry-community/go-cfenvnested"
)

func main() {
	appEnv := cfenvnested.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. Please ensure you make your changes in a branch off of the develop branch, not the master branch.

Remember that you probably need to patch https://github.com/cloudfoundry-community/go-cfenv project as well.

About

Fork of go-cfenv to allow nested service credentials

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages