Documentation ¶
Index ¶
- Constants
- Variables
- func AddToScheme(obj runtime.SchemeBuilder) error
- func Exec(ctx context.Context, log logr.Logger, runtime *Runtime, transform Transform) error
- func LogMetadata(c context.Context, a AppInfo) error
- func NewZapLogger(name, version string, verbosityLevel int, useProductionConfig bool) (logr.Logger, error)
- func RunCommand(ctx context.Context, input []byte, transforms []Transform) ([]byte, error)
- type AppInfo
- type DesiredResources
- func (d *DesiredResources) Get(ctx context.Context, obj client.Object, resName string) error
- func (d *DesiredResources) GetComposite(_ context.Context, obj client.Object) error
- func (d *DesiredResources) GetCompositeConnectionDetails(_ context.Context) []xfnv1alpha1.ExplicitConnectionDetail
- func (d *DesiredResources) GetFromObject(ctx context.Context, o client.Object, kon string) error
- func (d *DesiredResources) List(_ context.Context) []Resource
- func (d *DesiredResources) Put(ctx context.Context, obj client.Object) error
- func (d *DesiredResources) PutCompositeConnectionDetail(ctx context.Context, cd xfnv1alpha1.ExplicitConnectionDetail)
- func (d *DesiredResources) PutIntoObject(ctx context.Context, o client.Object, kon string, refs ...xkube.Reference) error
- func (d *DesiredResources) Remove(ctx context.Context, name string) error
- func (d *DesiredResources) RemoveCompositeConnectionDetail(ctx context.Context, cd xfnv1alpha1.ExplicitConnectionDetail) error
- func (d *DesiredResources) SetComposite(_ context.Context, obj client.Object) error
- type ObservedResources
- func (o *ObservedResources) Get(ctx context.Context, obj client.Object, resName string) error
- func (o *ObservedResources) GetComposite(_ context.Context, obj client.Object) error
- func (o *ObservedResources) GetCompositeConnectionDetails(_ context.Context) *[]xfnv1alpha1.ExplicitConnectionDetail
- func (o *ObservedResources) GetFromObject(ctx context.Context, obj client.Object, kon string) error
- func (o *ObservedResources) List(_ context.Context) []Resource
- type Resource
- type Result
- type Runtime
- type Transform
Constants ¶
const KeyFuncIO contextKey = iota
KeyFuncIO is the key to the context value where the functionIO pointer is stored
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
func AddToScheme ¶
func AddToScheme(obj runtime.SchemeBuilder) error
AddToScheme adds given SchemeBuilder to the Scheme.
func LogMetadata ¶
LogMetadata prints various metadata to the root logger. It prints version, architecture and current user ID and returns nil.
func NewZapLogger ¶ added in v1.0.0
Types ¶
type AppInfo ¶
type AppInfo struct {
Version, Commit, Date, AppName, AppLongName string
}
AppInfo defines application information
type DesiredResources ¶ added in v1.0.0
type DesiredResources struct {
// contains filtered or unexported fields
}
func (*DesiredResources) Get ¶ added in v1.0.0
Get unmarshalls the resource from the desired array. This will return any changes that a previous function has made to the desired array.
func (*DesiredResources) GetComposite ¶ added in v1.0.0
GetComposite unmarshalls the desired composite from the function io to the given object.
func (*DesiredResources) GetCompositeConnectionDetails ¶ added in v1.0.0
func (d *DesiredResources) GetCompositeConnectionDetails(_ context.Context) []xfnv1alpha1.ExplicitConnectionDetail
GetCompositeConnectionDetails returns the connection details of the desired composite
func (*DesiredResources) GetFromObject ¶ added in v1.0.0
GetFromObject gets the k8s resource o from a provider kubernetes object kon (Kube Object Name) from the desired array of the FunctionIO.
func (*DesiredResources) List ¶ added in v1.0.0
func (d *DesiredResources) List(_ context.Context) []Resource
List returns the list of managed resources from desired object
func (*DesiredResources) Put ¶ added in v1.0.0
Put adds the object as is to the FunctionIO desired array. It assumes that the given object is adheres to Crossplane's ManagedResource model.
func (*DesiredResources) PutCompositeConnectionDetail ¶ added in v1.0.0
func (d *DesiredResources) PutCompositeConnectionDetail(ctx context.Context, cd xfnv1alpha1.ExplicitConnectionDetail)
PutCompositeConnectionDetail appends a connection detail to the connection details slice of this desired composite
func (*DesiredResources) PutIntoObject ¶ added in v1.0.0
func (d *DesiredResources) PutIntoObject(ctx context.Context, o client.Object, kon string, refs ...xkube.Reference) error
PutIntoObject adds or updates the desired resource into its kube object
func (*DesiredResources) Remove ¶ added in v1.0.0
func (d *DesiredResources) Remove(ctx context.Context, name string) error
Remove removes a resource by name from the managed resources expect an error if resource not found
func (*DesiredResources) RemoveCompositeConnectionDetail ¶ added in v1.0.0
func (d *DesiredResources) RemoveCompositeConnectionDetail(ctx context.Context, cd xfnv1alpha1.ExplicitConnectionDetail) error
RemoveCompositeConnectionDetail removes a connection detail from the slice of connection details of this desired composite
func (*DesiredResources) SetComposite ¶ added in v1.0.0
SetComposite sets a new desired composite to the function from the given object.
type ObservedResources ¶ added in v1.0.0
type ObservedResources struct {
// contains filtered or unexported fields
}
func (*ObservedResources) Get ¶ added in v1.0.0
Get unmarshalls the managed resource with the given name into the given object. It reads from the Observed array.
func (*ObservedResources) GetComposite ¶ added in v1.0.0
GetComposite unmarshalls the observed composite from the function io to the given object.
func (*ObservedResources) GetCompositeConnectionDetails ¶ added in v1.0.0
func (o *ObservedResources) GetCompositeConnectionDetails(_ context.Context) *[]xfnv1alpha1.ExplicitConnectionDetail
GetCompositeConnectionDetails returns the connection details of the observed composite
func (*ObservedResources) GetFromObject ¶ added in v1.0.0
GetFromObject gets the k8s resource o from a provider kubernetes object kon (Kube Object Name) from the observed array of the FunctionIO.
type Resource ¶ added in v1.0.0
type Resource interface { GetName() string GetRaw() []byte SetRaw([]byte) // Returns this resource as a DesiredResource. // Depending on the concrete underlying type, not all fields are populated. GetDesiredResource() xfnv1alpha1.DesiredResource // Returns this resource as an ObservedResource. // Depending on the concrete underlying type, not all fields are populated. GetObservedResource() xfnv1alpha1.ObservedResource }
type Result ¶ added in v1.0.0
func NewFatal ¶ added in v1.0.0
NewFatal returns a fatal Result from a message string. The result is fatal, subsequent Composition Functions may run, but the Composition Function pipeline run will be considered a failure and the first error will be returned.
func NewFatalErr ¶ added in v1.0.0
NewFatalErr returns a fatal Result from a message string and an error. The result is fatal, subsequent Composition Functions may run, but the Composition Function pipeline run will be considered a failure and the first error will be returned.
type Runtime ¶
type Runtime struct { Observed ObservedResources Desired DesiredResources // contains filtered or unexported fields }
Runtime a struct which encapsulates crossplane FunctionIO