Crate cf_services

Source
Expand description

§cf-services

The cf-services crate provides an easy way to retrieve information about services bounded to an application in Cloud Foundry.

It retrieves and parses the cf_services::VCAP_SERVICES environment variable into a struct for easier consumption.

§Retrieving Services

To retrieve all the services, simply use cf_services::get_services_from_env.

§Service Credential

To retrieve a service’s credential information, either use cf_services::get_service_cred_from_env or the convenience function cf_services::get_service_credentials.

Structs§

Credentials
The credentials information for authenticating with the service.
Service
The high level service information for a service bounded to an application. Multiple services of the same type can be bounded to an application (e.g. multiple Config Servers).

Enums§

CFError
Enumeration of the different errors that can occur.

Constants§

VCAP_SERVICES
The environment variable key that contains all the bounded services to the application.

Functions§

get_service_cred_from_env
Retrieves the credential information of the specified service.
get_service_credentials
Retrieves the credential information from the provided services that match the specified service name.
get_services_from_env
Retrieves all service information.