resource

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: 29

Documentation

Overview

Package resource contains utilities to convert protobuf representations of Crossplane resources to unstructured Go types, often with convenient getters and setters.

Index

Constants

View Source
const (
	// CredentialsTypeData is a Credential of type Data.
	CredentialsTypeData = "Data"
)

Variables

This section is empty.

Functions

func AsObject

func AsObject(s *structpb.Struct, o runtime.Object) error

AsObject gets the supplied Kubernetes object from the supplied struct.

func AsStruct

func AsStruct(o runtime.Object) (*structpb.Struct, error)

AsStruct gets the supplied struct from the supplied Kubernetes object.

func MustStructJSON

func MustStructJSON(j string) *structpb.Struct

MustStructJSON is intended only for use in tests. It returns the supplied JSON string as a struct. It panics if it can't.

func MustStructObject

func MustStructObject(o runtime.Object) *structpb.Struct

MustStructObject is intended only for use in tests. It returns the supplied object as a struct. It panics if it can't.

Types

type Composite

type Composite struct {
	Resource          *composite.Unstructured
	ConnectionDetails ConnectionDetails
}

A Composite resource - aka an XR.

type ConnectionDetails

type ConnectionDetails map[string][]byte

ConnectionDetails created or updated during an operation on an external resource, for example usernames, passwords, endpoints, ports, etc.

type Credentials added in v0.3.0

type Credentials struct {
	// Type represents the type of credentials.
	Type CredentialsType

	// Data is a map of key-value pairs where the keys are strings, and the values are byte slices
	// containing sensitive data.
	Data map[string][]byte
}

Credentials is a secret requested by a Function.

type CredentialsType added in v0.3.0

type CredentialsType string

CredentialsType is the type of credentials.

type DesiredComposed

type DesiredComposed struct {
	Resource *composed.Unstructured

	Ready Ready
}

DesiredComposed reflects the desired state of a composed resource.

func NewDesiredComposed

func NewDesiredComposed() *DesiredComposed

NewDesiredComposed returns a new, empty desired composed resource.

type Extra added in v0.2.0

type Extra struct {
	Resource *unstructured.Unstructured
}

Extra is a resource requested by a Function.

type Name

type Name string

A Name uniquely identifies a composed resource within a Composition Function pipeline. It's not the resource's metadata.name.

type ObservedComposed

type ObservedComposed struct {
	Resource          *composed.Unstructured
	ConnectionDetails ConnectionDetails
}

ObservedComposed reflects the observed state of a composed resource.

type Ready

type Ready string

Ready indicates whether a composed resource should be considered ready.

const (
	ReadyUnspecified Ready = "Unspecified"
	ReadyTrue        Ready = "True"
	ReadyFalse       Ready = "False"
)

Composed resource readiness.

Directories

Path Synopsis
Package composed contains an unstructured composed resource.
Package composed contains an unstructured composed resource.
Package composite contains an unstructured composite resource (XR).
Package composite contains an unstructured composite resource (XR).

Jump to

Keyboard shortcuts

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