Documentation ¶
Overview ¶
Package servicebindings provides a service for inspecting and retrieving data from service binding.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
type Binding struct { // Name is the name of the binding. Name string // Path is the path to the binding directory. Path string // Type is the type of the binding. Type string // Provider is the provider of the binding. Provider string // Entries is the set of entries that make up the binding. Entries map[string]*Entry }
Binding represents metadata related to an external service.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry represents the read-only content of a binding entry.
func NewEntry ¶
NewEntry returns a new Entry whose content is given by the file at the provided path.
func NewWithValue ¶ added in v2.14.0
NewWithValue returns a new Entry with predefined value.
func (*Entry) Close ¶
Close closes the entry and resets it for reading. After calling Close, any subsequent calls to Read will read entry data from the beginning. Close may be called on a closed entry without error.
func (*Entry) Read ¶
Read reads up to len(b) bytes from the entry. It returns the number of bytes read and any error encountered. At end of entry data, Read returns 0, io.EOF. Close must be called when all read operations are complete.
func (*Entry) ReadBytes ¶
ReadBytes reads the entire raw content of the entry. There is no need to call Close after calling ReadBytes.
func (*Entry) ReadString ¶
ReadString reads the entire content of the entry as a string. There is no need to call Close after calling ReadString.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves service bindings according to the kubernetes binding spec: https://github.com/k8s-service-bindings/spec#workload-projection.
It also supports backwards compatibility with the legacy service binding spec: https://github.com/buildpacks/spec/blob/main/extensions/bindings.md
func (*Resolver) Resolve ¶
Resolve returns all bindings matching the given type and optional provider (case-insensitive). To match on type only, provider may be an empty string. Returns an error if there are problems loading bindings from the file system.
The location of bindings is given by one of the following, in order of precedence:
- SERVICE_BINDING_ROOT environment variable
- CNB_BINDINGS environment variable, if above is not set
- `<platformDir>/bindings`, if both above are not set