Crate cf_env

source ·
Expand description

Easy and typed abstraction on Cloud Foundry Environment variables

It allows you to get:

  • Services, optionally filtered by name or type
  • Application infos
  • Cloud Foundry app instance set variables, most of the times starting with CF_

It’s meant to get you away from boilerplating and get you started with typed variables while keeping simplicity

Modules§

Functions§

  • Get’s you the information from VCAP_APPLICATION as a typed Application
  • Get’s the value from DATABASE_URL as a typed Uri
  • Get’s the value from HOME as a typed PathBuf
  • Get’s the value from CF_INSTANCE_ADDR as a typed SocketAddr
  • Get’s the value from CF_INSTANCE_GUID as a typed GUID
  • Get’s the value from CF_INSTANCE_INDEX as a typed u128
  • Get’s the value from CF_INSTANCE_INTERNAL_IP as a typed IpAddr
  • Get’s the value from CF_INSTANCE_IP as a typed IpAddr
  • Get’s the value from CF_INSTANCE_PORT as a typed u16
  • Get’s the value from LANG as a typed Locale
  • Get’s the value from MEMORY_LIMIT as a typed MemoryLimit
  • Get’s the value from PORT as a typed 16
  • Get’s the value from PWD as a typed PathBuf
  • Get’s you a single service fromVCAP_SERVICES by it’s name
  • Get’s the value from VCAP_SERVICES as a typed HashMap of Strings and a list of Services
  • Get’s you a a list services fromVCAP_SERVICES by their type
  • Get’s the value from TMPDIR as a typed PathBuf
  • Get’s the value from USER
  • Checks if VCAP_APPLICATION is defined, if so uses as the indicator that the app is running in a Cloud Foundry Environment.