resource

package
v0.2.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resource provides facilities to convert CRDs and XRDs to HCL schemas.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	ApiVersion string
	Kind       string
}

Key is the key of a K8s object.

func (Key) String

func (k Key) String() string

type Schemas

type Schemas struct {
	// contains filtered or unexported fields
}

Schemas maintains attribute schemas for a set of K8s types.

func Compose

func Compose(schemas ...*Schemas) *Schemas

Compose composes the supplied schemas into a singular instance.

func ToSchemas

func ToSchemas(objects ...runtime.Object) *Schemas

ToSchemas converts CRDs and XRDs present in the supplied objects into a Schemas instance.

func (*Schemas) FilterScope

func (s *Schemas) FilterScope(scope Scope) *Schemas

FilterScope returns schemas filtered by scope.

func (*Schemas) Keys

func (s *Schemas) Keys() []Key

Keys returns the keys known to this instance.

func (*Schemas) Schema

func (s *Schemas) Schema(apiVersion, kind string) *schema.AttributeSchema

Schema returns the attribute schema for the specified API version and kind, or nil if a schema for this key could not be found.

type Scope

type Scope string

Scope is the scope for which CRDs are loaded. This can be "cluster", "namespaced" or "both".

const (
	ScopeNamespaced Scope = "namespaced"
	ScopeCluster    Scope = "cluster"
	ScopeBoth       Scope = "both"
)

type ScopedAttributeSchema

type ScopedAttributeSchema struct {
	schema.AttributeSchema
	Scope Scope
}

ScopedAttributeSchema wraps an attribute schema and also tracks the scope for the top-level objects.

Directories

Path Synopsis
Package loader provides facilities for loading CRDs and XRDs from various sources.
Package loader provides facilities for loading CRDs and XRDs from various sources.

Jump to

Keyboard shortcuts

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