Documentation
¶
Overview ¶
Package contextfn implements an in-process composition function that the CLI hosts to inject and capture pipeline context for `crossplane render`. It replaces the previous function-go-templating based approach so the CLI no longer depends on an external function image for context handling.
Index ¶
- Constants
- type Handle
- func (h *Handle) Captured() *structpb.Struct
- func (h *Handle) CompositeCaptureStep() apiextensionsv1.PipelineStep
- func (h *Handle) CompositeSeedStep() apiextensionsv1.PipelineStep
- func (h *Handle) Function() pkgv1.Function
- func (h *Handle) OperationCaptureStep() opsv1alpha1.PipelineStep
- func (h *Handle) OperationSeedStep() opsv1alpha1.PipelineStep
- func (h *Handle) Stop()
Constants ¶
const FunctionName = "crossplane-render-context"
FunctionName is the pkgv1.Function.Name used for the in-process context function. It is exported because callers must key the FunctionInput address map with it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handle ¶
type Handle struct {
// Target is the gRPC target that dials the function. Set this as the
// FunctionInput address passed to the render engine.
Target string
// contains filtered or unexported fields
}
Handle is the owner of a running in-process context function.
func Start ¶
Start starts an in-process gRPC server that implements the composition function RunFunction RPC for context seeding and capture. The server listens on a unix-domain socket inside a fresh temp directory. Callers must call Handle.Stop when done.
func (*Handle) Captured ¶
Captured returns the context observed by the capture step, or nil if capture did not run.
func (*Handle) CompositeCaptureStep ¶
func (h *Handle) CompositeCaptureStep() apiextensionsv1.PipelineStep
CompositeCaptureStep returns a Composition pipeline step that captures the end-of-pipeline context into the handle. Append it to a Composition pipeline.
func (*Handle) CompositeSeedStep ¶
func (h *Handle) CompositeSeedStep() apiextensionsv1.PipelineStep
CompositeSeedStep returns a Composition pipeline step that seeds the pipeline context from the handle's context data. Prepend it to a Composition pipeline.
func (*Handle) Function ¶
Function returns the Function definition the caller must add to the render engine's functions list so the in-process context function is known by name.
func (*Handle) OperationCaptureStep ¶
func (h *Handle) OperationCaptureStep() opsv1alpha1.PipelineStep
OperationCaptureStep is the Operation pipeline equivalent of CompositeCaptureStep.
func (*Handle) OperationSeedStep ¶
func (h *Handle) OperationSeedStep() opsv1alpha1.PipelineStep
OperationSeedStep is the Operation pipeline equivalent of CompositeSeedStep.