meta

package
v0.0.0-...-86d9e09 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package meta provides definition of core metadata resources.

Index

Constants

View Source
const NamespaceName resource.Namespace = "meta"

NamespaceName is the name of 'meta' namespace.

View Source
const NamespaceType = resource.Type("Namespaces.meta.cosi.dev")

NamespaceType is the type of Namespace.

View Source
const Owner resource.Owner = "meta"

Owner is the owner for the 'meta' objects.

View Source
const ResourceDefinitionType = resource.Type("ResourceDefinitions.meta.cosi.dev")

ResourceDefinitionType is the type of ResourceDefinition.

Variables

This section is empty.

Functions

This section is empty.

Types

type Namespace

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

Namespace provides metadata about namespaces.

func NewNamespace

func NewNamespace(id resource.ID, spec NamespaceSpec) *Namespace

NewNamespace initializes a Namespace resource.

func (*Namespace) DeepCopy

func (r *Namespace) DeepCopy() resource.Resource

DeepCopy implements resource.Resource.

func (*Namespace) Metadata

func (r *Namespace) Metadata() *resource.Metadata

Metadata implements resource.Resource.

func (*Namespace) ResourceDefinition

func (r *Namespace) ResourceDefinition() ResourceDefinitionSpec

ResourceDefinition implements core.ResourceDefinitionProvider interface.

func (*Namespace) Spec

func (r *Namespace) Spec() interface{}

Spec implements resource.Resource.

func (*Namespace) String

func (r *Namespace) String() string

type NamespaceSpec

type NamespaceSpec struct {
	Description string `yaml:"description"`
}

NamespaceSpec provides Namespace definition.

type PrintColumn

type PrintColumn struct {
	Name     string `yaml:"name"`
	JSONPath string `yaml:"jsonPath"`
}

PrintColumn describes extra columns to print for the resources.

type ResourceDefinition

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

ResourceDefinition provides metadata about namespaces.

func NewResourceDefinition

func NewResourceDefinition(spec ResourceDefinitionSpec) (*ResourceDefinition, error)

NewResourceDefinition initializes a ResourceDefinition resource.

func (*ResourceDefinition) DeepCopy

func (r *ResourceDefinition) DeepCopy() resource.Resource

DeepCopy implements resource.Resource.

func (*ResourceDefinition) Metadata

func (r *ResourceDefinition) Metadata() *resource.Metadata

Metadata implements resource.Resource.

func (*ResourceDefinition) ResourceDefinition

func (r *ResourceDefinition) ResourceDefinition() ResourceDefinitionSpec

ResourceDefinition implements core.ResourceDefinitionProvider interface.

func (*ResourceDefinition) Spec

func (r *ResourceDefinition) Spec() interface{}

Spec implements resource.Resource.

func (*ResourceDefinition) String

func (r *ResourceDefinition) String() string

type ResourceDefinitionProvider

type ResourceDefinitionProvider interface {
	ResourceDefinition() ResourceDefinitionSpec
}

ResourceDefinitionProvider is implemented by resources which can be registered automatically.

type ResourceDefinitionSpec

type ResourceDefinitionSpec struct {
	Type             resource.Type      `yaml:"type"`
	DisplayType      string             `yaml:"displayType"`
	DefaultNamespace resource.Namespace `yaml:"defaultNamespace"`
	Aliases          []resource.Type    `yaml:"aliases"`
	PrintColumns     []PrintColumn      `yaml:"printColumns"`
}

ResourceDefinitionSpec provides ResourceDefinition definition.

func (*ResourceDefinitionSpec) Fill

func (spec *ResourceDefinitionSpec) Fill() error

Fill the spec while validating any missing items.

func (*ResourceDefinitionSpec) ID

func (spec *ResourceDefinitionSpec) ID() resource.ID

ID computes id of the resource definition.

Jump to

Keyboard shortcuts

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