bindings

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(binds libcnb.Bindings, predicates ...Predicate) libcnb.Bindings

Resolve returns all bindings from binds that match every Predicate in predicates.

func ResolveOne

func ResolveOne(binds libcnb.Bindings, predicates ...Predicate) (libcnb.Binding, bool, error)

ResolveOne returns a single binding from bindings that match every Predicate if present. If exactly one match is found ResolveOne returns the binding and true. If zero matches are found, ResolveOne returns an empty binding and false. An error is returned if multiple matches are found.

Types

type Predicate

type Predicate func(bind libcnb.Binding) bool

Predicate should return true if it matches a given binding.

func OfProvider

func OfProvider(p string) Predicate

OfProvider returns a Predicate that returns true if a given binding has Provider that matches p. The comparison is case-insensitive.

func OfType

func OfType(t string) Predicate

OfType returns a Predicate that returns true if a given binding has Type that matches t. The comparison is case-insensitive.

func WithName

func WithName(n string) Predicate

WithName returns a Predicate that returns true if a given binding has Name that matches n. The comparison is case-insensitive.

Jump to

Keyboard shortcuts

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