require

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	WithGVK(apiVersion, kind string) RequirementBuilder
	WithRO(object runtime.Object) ROBuilder
}

func As

func As(objectName string) Builder

type ROBuilder

type ROBuilder interface {
	RequirementBuilder
	WithVersion(version string) ROBuilder
	WithScheme(scheme runtime.Scheme) ROBuilder
}

type Requirement

type Requirement interface {
	Get() (name string, selector *fnv1.ResourceSelector, err error)
}

type RequirementBuilder

type RequirementBuilder interface {
	WithNamespace(namespace *string) RequirementBuilder
	MatchName(resourceName string) Requirement
	MatchLabels(labels map[string]string) Requirement
}

type Requirements

type Requirements struct {
	// contains filtered or unexported fields
}

func Requires

func Requires(requirements ...Requirement) (*Requirements, error)

Requires returns a new Requirements instance that requires the given extra resources.

func (*Requirements) Assure

func (r *Requirements) Assure(req *fnv1.RunFunctionRequest) (provided bool, err error)

Assure checks if the requirements are met in the given request. If not, it returns false. Per the function protocol, Crossplane sets the map key to an empty Resources message when it tried to fetch a resource that does not exist. So:

  • key missing → not requested yet → wait for the next iteration
  • key present, wrong item count → real error
  • all keys present and valid → continue

Errors still return provided=true so that existing callers following the README pattern (checking !provided before err != nil) keep surfacing errors instead of silently waiting.

func (*Requirements) Register

func (r *Requirements) Register(rsp *fnv1.RunFunctionResponse)

Register registers the requirements in the given response, merging with any existing requirements rather than overwriting them.

Jump to

Keyboard shortcuts

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