composed

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 14

Documentation

Overview

Package composed contains an unstructured composed resource.

Example
// Create a new, empty composed resource.
cd := New()

// Set our composed resource's type metadata.
cd.SetAPIVersion("example.org/v1")
cd.SetKind("CoolComposedResource")

// Set our composed resource's object metadata.
cd.SetLabels(map[string]string{"coolness": "high"})

// Set an arbitrary spec field.
cd.SetInteger("spec.coolness", 9001)

// Marshal our composed resource to YAML. We just do this for illustration
// purposes. Normally you'd add it to the map of desired resources you send
// in your RunFunctionResponse.
y, _ := yaml.Marshal(cd)

fmt.Println(string(y))
Output:

apiVersion: example.org/v1
kind: CoolComposedResource
metadata:
  labels:
    coolness: high
spec:
  coolness: 9001

Index

Examples

Constants

This section is empty.

Variables

View Source
var Scheme *runtime.Scheme

Scheme used to determine the type of any runtime.Object passed to From.

Functions

This section is empty.

Types

type Unstructured

type Unstructured struct {
	unstructured.Unstructured
}

An Unstructured composed resource.

func From

func From(o runtime.Object) (*Unstructured, error)

From creates a new unstructured composed resource from the supplied object.

Example
// Add all v1beta2 types to the scheme so that From can automatically
// determine their apiVersion and kind.
v1beta2.AddToScheme(Scheme)

// Create a strongly typed runtime.Object, imported from a provider.
b := &v1beta2.Bucket{
	ObjectMeta: metav1.ObjectMeta{
		Labels: map[string]string{
			"coolness": "high",
		},
	},
	Spec: v1beta2.BucketSpec{
		ForProvider: v1beta2.BucketParameters{
			Region: ptr.To[string]("us-east-2"),
		},
	},
}

// Create a composed resource from the runtime.Object.
cd, err := From(b)
if err != nil {
	panic(err)
}

// Marshal our composed resource to YAML. We just do this for illustration
// purposes. Normally you'd add it to the map of desired resources you send
// in your RunFunctionResponse.
y, _ := yaml.Marshal(cd)

fmt.Println(string(y))
Output:

apiVersion: s3.aws.upbound.io/v1beta2
kind: Bucket
metadata:
  labels:
    coolness: high
spec:
  forProvider:
    region: us-east-2
status:
  observedGeneration: 0

func New

func New() *Unstructured

New returns a new unstructured composed resource.

func (*Unstructured) DeepCopy

func (cd *Unstructured) DeepCopy() *Unstructured

DeepCopy this composed resource.

func (*Unstructured) DeepCopyInto

func (cd *Unstructured) DeepCopyInto(out *Unstructured)

DeepCopyInto the supplied composed resource.

func (*Unstructured) DeepCopyObject

func (cd *Unstructured) DeepCopyObject() runtime.Object

DeepCopyObject of this composed resource.

func (*Unstructured) GetBool

func (cd *Unstructured) GetBool(path string) (bool, error)

GetBool value of the supplied field path.

func (*Unstructured) GetCondition

func (cd *Unstructured) GetCondition(ct xpv1.ConditionType) xpv1.Condition

GetCondition of this Composed resource.

func (*Unstructured) GetInteger

func (cd *Unstructured) GetInteger(path string) (int64, error)

GetInteger value of the supplied field path.

func (*Unstructured) GetObservedGeneration added in v0.3.0

func (cd *Unstructured) GetObservedGeneration() int64

GetObservedGeneration of this Composed resource.

func (*Unstructured) GetPublishConnectionDetailsTo

func (cd *Unstructured) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo

GetPublishConnectionDetailsTo of this Composed resource.

func (*Unstructured) GetString

func (cd *Unstructured) GetString(path string) (string, error)

GetString value of the supplied field path.

func (*Unstructured) GetStringArray

func (cd *Unstructured) GetStringArray(path string) ([]string, error)

GetStringArray value of the supplied field path.

func (*Unstructured) GetStringObject

func (cd *Unstructured) GetStringObject(path string) (map[string]string, error)

GetStringObject value of the supplied field path.

func (*Unstructured) GetValue

func (cd *Unstructured) GetValue(path string) (any, error)

GetValue of the supplied field path.

func (*Unstructured) GetValueInto

func (cd *Unstructured) GetValueInto(path string, out any) error

GetValueInto the supplied type.

func (*Unstructured) GetWriteConnectionSecretToReference

func (cd *Unstructured) GetWriteConnectionSecretToReference() *xpv1.SecretReference

GetWriteConnectionSecretToReference of this Composed resource.

func (*Unstructured) MarshalJSON

func (cd *Unstructured) MarshalJSON() ([]byte, error)

MarshalJSON for this composed resource.

func (*Unstructured) SetBool

func (cd *Unstructured) SetBool(path string, value bool) error

SetBool value at the supplied field path.

func (*Unstructured) SetConditions

func (cd *Unstructured) SetConditions(c ...xpv1.Condition)

SetConditions of this Composed resource.

func (*Unstructured) SetInteger

func (cd *Unstructured) SetInteger(path string, value int64) error

SetInteger value at the supplied field path.

func (*Unstructured) SetObservedGeneration added in v0.3.0

func (cd *Unstructured) SetObservedGeneration(generation int64)

SetObservedGeneration of this Composed resource.

func (*Unstructured) SetPublishConnectionDetailsTo

func (cd *Unstructured) SetPublishConnectionDetailsTo(ref *xpv1.PublishConnectionDetailsTo)

SetPublishConnectionDetailsTo of this Composed resource.

func (*Unstructured) SetString

func (cd *Unstructured) SetString(path, value string) error

SetString value at the supplied field path.

func (*Unstructured) SetValue

func (cd *Unstructured) SetValue(path string, value any) error

SetValue at the supplied field path.

func (*Unstructured) SetWriteConnectionSecretToReference

func (cd *Unstructured) SetWriteConnectionSecretToReference(r *xpv1.SecretReference)

SetWriteConnectionSecretToReference of this Composed resource.

Jump to

Keyboard shortcuts

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