utils

package
v1.4.1-0...-3bf76e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2017 License: MIT Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServiceBinding

func AddServiceBinding(db *sql.DB, serviceBinding sharedModel.ServiceBinding) error

AddServiceBinding - adds a row to service_bindings database

func AddServiceInstance

func AddServiceInstance(db *sql.DB, serviceInstance sharedModel.ServiceInstance) error

AddServiceInstance - adds a row to service_isntances database

func DeleteServiceBinding

func DeleteServiceBinding(db *sql.DB, serviceBindingID string) error

DeleteServiceBinding - deletes from service_bindings based on service binding ID

func DeleteServiceInstance

func DeleteServiceInstance(db *sql.DB, serviceInstance sharedModel.ServiceInstance) error

DeleteServiceInstance - deletes from service_instances based on service instance ID

func DeleteServiceInstanceBindings

func DeleteServiceInstanceBindings(db *sql.DB, serviceInstanceID string) error

DeleteServiceInstanceBindings - deletes from service_bindings based on service instance ID

func ExtractVarsFromRequest

func ExtractVarsFromRequest(r *http.Request, varName string) string

ExtractVarsFromRequest - extracts variables from http request

func GetPath

func GetPath(paths []string) string

GetPath - builds a path string using os native path separators

func GetServiceInstance

func GetServiceInstance(db *sql.DB, serviceInstanceID string) (sharedModel.ServiceInstance, error)

GetServiceInstance - loads a service instance to memory from database

func GetVCAPApplicationVars

func GetVCAPApplicationVars(object interface{}) error

GetVCAPApplicationVars - populates an object based on the "VCAP_APPLICATION" environment variables

func ProvisionDataFromRequest

func ProvisionDataFromRequest(r io.Reader, object interface{}) error

ProvisionDataFromRequest - Unmarhsals json to object

func ReadAndUnmarshal

func ReadAndUnmarshal(object interface{}, dir string, fileName string) error

ReadAndUnmarshal - loads file into object

func ReadFile

func ReadFile(path string, ioRead ioRead) (content []byte, err error)

ReadFile - loads a file to a byte array

func RemoveGreenFromURI

func RemoveGreenFromURI(URI string) string

RemoveGreenFromURI - removes "-green" from provided URI for zero downtime deployments

func SetupBindingDB

func SetupBindingDB(db *sql.DB) error

SetupBindingDB - creates the service_bindings DB if it does not exist

func SetupInstanceDB

func SetupInstanceDB(db *sql.DB) error

SetupInstanceDB - creates the service_instances DB if it does not exist

func UpdateServiceInstance

func UpdateServiceInstance(db *sql.DB, serviceInstanceID string, probability float64, frequency int) error

UpdateServiceInstance - update service_instances database

func WriteResponse

func WriteResponse(w http.ResponseWriter, code int, object interface{})

WriteResponse - creates an http response

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL