MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / vcapServices

Function vcapServices

src/java/frameworks/maria_db_jdbc_test.go:30–43  ·  view source on GitHub ↗

vcapServices builds a minimal VCAP_SERVICES JSON string for a named service with a uri credential.

(label, name string, tags []string)

Source from the content-addressed store, hash-verified

28
29// vcapServices builds a minimal VCAP_SERVICES JSON string for a named service with a uri credential.
30func vcapServices(label, name string, tags []string) string {
31 tagJSON := "[]"
32 if len(tags) > 0 {
33 tagJSON = `["`
34 for i, t := range tags {
35 if i > 0 {
36 tagJSON += `","`
37 }
38 tagJSON += t
39 }
40 tagJSON += `"]`
41 }
42 return `{"` + label + `":[{"name":"` + name + `","label":"` + label + `","tags":` + tagJSON + `,"credentials":{"uri":"mysql://host/db"}}]}`
43}
44
45var _ = Describe("MariaDBJDBC", func() {
46 var (

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected