api

package
v0.0.0-...-f6f694c Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeSpec

func DecodeSpec(src map[string]any, dst any) error

DecodeSpec decodes an unstructured spec (map[string]any) into a typed struct using the struct's `json` tags.

Types

type Controller

type Controller[T Spec] interface {
	Reconcile(ctx context.Context, r Typed[T]) (status map[string]any, err error)
}

type Deleter

type Deleter[T Spec] interface {
	Delete(ctx context.Context, meta ResourceMeta) (status map[string]any, err error)
}

type Differ

type Differ[T Spec] interface {
	Diff(ctx context.Context, desired Typed[T], observed map[string]any) (bool, map[string]any, error)
}

type Observer

type Observer interface {
	Observe(ctx context.Context, meta ResourceMeta) (map[string]any, error)
}

type Ref

type Ref struct {
	Kind     string `json:"kind" yaml:"kind"`
	Name     string `json:"name" yaml:"name"`
	Optional bool   `json:"optional,omitempty" yaml:"optional,omitempty"`
}

Ref identifies another resource in the same manifests root.

type ResourceMeta

type ResourceMeta struct {
	Name      string            `yaml:"name" json:"name"`
	Namespace string            `yaml:"namespace,omitempty" json:"namespace,omitempty"`
	Labels    map[string]string `yaml:"labels,omitempty" json:"labels,omitempty"`
}

type SecretDecrypter

type SecretDecrypter interface {
	DecryptArmored(armored string) ([]byte, error)
}

SecretDecrypter is a minimal interface controllers can use to unseal ciphertext.

type Spec

type Spec interface{ Validate() error }

type Typed

type Typed[T Spec] struct {
	APIVersion string
	Kind       string
	Metadata   ResourceMeta
	Spec       T
}

type Unstructured

type Unstructured struct {
	APIVersion string         `yaml:"apiVersion" json:"apiVersion"`
	Kind       string         `yaml:"kind" json:"kind"`
	Metadata   ResourceMeta   `yaml:"metadata" json:"metadata"`
	Spec       map[string]any `yaml:"spec" json:"spec"`
	Status     map[string]any `yaml:"status,omitempty" json:"status,omitempty"`
	DependsOn  []Ref          `json:"dependsOn,omitempty" yaml:"dependsOn,omitempty"`
}

Jump to

Keyboard shortcuts

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