Documentation ¶
Index ¶
- Constants
- Variables
- func AddToScheme(obj runtime.SchemeBuilder) error
- func Exec(ctx context.Context, runtime *Runtime, transform Transform) 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) PutIntoObserveOnlyObject(ctx context.Context, o client.Object, kon string, refs ...xkube.Reference) error
- func (d *DesiredResources) PutWithResourceName(ctx context.Context, obj client.Object, resName string) 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.
Types ¶
type AppInfo ¶
type AppInfo struct {
Version, Commit, Date, AppName, AppLongName string
}
AppInfo defines application information
type DesiredResources ¶
type DesiredResources struct {
// contains filtered or unexported fields
}
func (*DesiredResources) Get ¶
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 ¶
GetComposite unmarshalls the desired composite from the function io to the given object.
func (*DesiredResources) GetCompositeConnectionDetails ¶
func (d *DesiredResources) GetCompositeConnectionDetails(_ context.Context) []xfnv1alpha1.ExplicitConnectionDetail
GetCompositeConnectionDetails returns the connection details of the desired composite
func (*DesiredResources) GetFromObject ¶
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 ¶
func (d *DesiredResources) List(_ context.Context) []Resource
List returns the list of managed resources from desired object
func (*DesiredResources) Put ¶
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 ¶
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 ¶
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, from docs:
The provider can fully manage the resource.
func (*DesiredResources) PutIntoObserveOnlyObject ¶
func (d *DesiredResources) PutIntoObserveOnlyObject(ctx context.Context, o client.Object, kon string, refs ...xkube.Reference) error
PutIntoObserveOnlyObject adds or updates the desired resource into its OBSERVE-ONLY kube object, from docs: PutIntoObject adds or updates the desired resource into its OBSERVE-ONLY kube object, from docs:
The provider can only observe the resource. This maps to the read-only scenario where the resource is fully controlled by third party application. The provider reads the resource manifest and stores in Object at status.atProvider.
func (*DesiredResources) PutWithResourceName ¶
func (d *DesiredResources) PutWithResourceName(ctx context.Context, obj client.Object, resName string) error
PutWithResourceName allows you to put the resource with a custom name into the desire array. This is useful to put back a resource that's already defined in the P+T composition.
func (*DesiredResources) Remove ¶
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 ¶
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 ¶
SetComposite sets a new desired composite to the function from the given object.
type ObservedResources ¶
type ObservedResources struct {
// contains filtered or unexported fields
}
func (*ObservedResources) Get ¶
Get unmarshalls the managed resource with the given name into the given object. It reads from the Observed array.
func (*ObservedResources) GetComposite ¶
GetComposite unmarshalls the observed composite from the function io to the given object.
func (*ObservedResources) GetCompositeConnectionDetails ¶
func (o *ObservedResources) GetCompositeConnectionDetails(_ context.Context) *[]xfnv1alpha1.ExplicitConnectionDetail
GetCompositeConnectionDetails returns the connection details of the observed composite
func (*ObservedResources) GetFromObject ¶
GetFromObject gets the k8s resource o from a provider kubernetes object kon (Kube Object Name) from the observed array of the FunctionIO.
type Resource ¶
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 ¶
func NewFatal ¶
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 ¶
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 Config *corev1.ConfigMap // contains filtered or unexported fields }
Runtime a struct which encapsulates crossplane FunctionIO
func NewRuntime ¶
NewRuntime creates a new Runtime object.
func (*Runtime) GetBootFromCompositionConfig ¶
GetBootFromCompositionConfig is a small function to help us retrieve bool values from configMap
func (*Runtime) GetRawFuncIO ¶
func (r *Runtime) GetRawFuncIO() *xfnv1alpha1.FunctionIO