Documentation ¶
Overview ¶
Package xfn contains functionality for running Composition Functions.
Index ¶
- type PackagedFunctionRunner
- func (r *PackagedFunctionRunner) GarbageCollectConnections(ctx context.Context, interval time.Duration)
- func (r *PackagedFunctionRunner) GarbageCollectConnectionsNow(ctx context.Context) (int, error)
- func (r *PackagedFunctionRunner) RunFunction(ctx context.Context, name string, req *v1beta1.RunFunctionRequest) (*v1beta1.RunFunctionResponse, error)
- type PackagedFunctionRunnerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PackagedFunctionRunner ¶ added in v1.14.0
type PackagedFunctionRunner struct {
// contains filtered or unexported fields
}
A PackagedFunctionRunner runs a Function by making a gRPC call to a Function package's runtime. It creates a gRPC client connection for each Function. The Function's endpoint is determined by reading the status.endpoint of the active FunctionRevision. You must call GarbageCollectClientConnections in order to ensure connections are properly closed.
func NewPackagedFunctionRunner ¶ added in v1.14.0
func NewPackagedFunctionRunner(c client.Reader, o ...PackagedFunctionRunnerOption) *PackagedFunctionRunner
NewPackagedFunctionRunner returns a FunctionRunner that runs a Function by making a gRPC call to a Function package's runtime.
func (*PackagedFunctionRunner) GarbageCollectConnections ¶ added in v1.14.0
func (r *PackagedFunctionRunner) GarbageCollectConnections(ctx context.Context, interval time.Duration)
GarbageCollectConnections runs every interval until the supplied context is cancelled. It garbage collects gRPC client connections to Functions that are no longer installed.
func (*PackagedFunctionRunner) GarbageCollectConnectionsNow ¶ added in v1.14.0
func (r *PackagedFunctionRunner) GarbageCollectConnectionsNow(ctx context.Context) (int, error)
GarbageCollectConnectionsNow immediately garbage collects any gRPC client connections to Functions that are no longer installed. It returns the number of connections garbage collected.
func (*PackagedFunctionRunner) RunFunction ¶ added in v1.14.0
func (r *PackagedFunctionRunner) RunFunction(ctx context.Context, name string, req *v1beta1.RunFunctionRequest) (*v1beta1.RunFunctionResponse, error)
RunFunction sends the supplied RunFunctionRequest to the named Function. The function is expected to be an installed Function.pkg.crossplane.io package.
type PackagedFunctionRunnerOption ¶ added in v1.14.0
type PackagedFunctionRunnerOption func(r *PackagedFunctionRunner)
A PackagedFunctionRunnerOption configures a PackagedFunctionRunner.
func WithLogger ¶
func WithLogger(l logging.Logger) PackagedFunctionRunnerOption
WithLogger configures the logger the PackageFunctionRunner should use.
func WithTLSConfig ¶ added in v1.14.0
func WithTLSConfig(cfg *tls.Config) PackagedFunctionRunnerOption
WithTLSConfig configures the client TLS the PackageFunctionRunner should use.