manifest

package
v0.41.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

manifest contains the parsing and validation logic for a resource provider manifest.

Resource provider manifests are authored by users and used to define the resource types that a resource provider supports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResourceProvider

type ResourceProvider struct {
	// Name is the resource provider name. This is also the namespace of the types defined by the resource provider.
	Name string `yaml:"name" validate:"required,resourceProviderNamespace"`

	// Types is a map of resource types in the resource provider.
	Types map[string]*ResourceType `yaml:"types" validate:"dive,keys,resourceType,endkeys,required"`
}

ResourceProvider represents a resource provider manifest.

func ReadBytes

func ReadBytes(data []byte) (*ResourceProvider, error)

ReadBytes reads a resource provider manifest from a byte slice.

func ReadFile

func ReadFile(filePath string) (*ResourceProvider, error)

ReadFile reads a resource provider manifest from a file.

type ResourceType

type ResourceType struct {
	// DefaultAPIVersion is the default API version for the resource type.
	DefaultAPIVersion *string `yaml:"defaultApiVersion,omitempty" validate:"omitempty,apiVersion"`

	// APIVersions is a map of API versions for the resource type.
	APIVersions map[string]*ResourceTypeAPIVersion `yaml:"apiVersions" validate:"dive,keys,apiVersion,endkeys,required"`
}

ResourceType represents a resource type in a resource provider manifest.

type ResourceTypeAPIVersion

type ResourceTypeAPIVersion struct {
	// Schema is the schema for the resource type.
	//
	// TODO: this allows anything right now, and will be ignored. We'll improve this in
	// a future pull-request.
	Schema any `yaml:"schema" validate:"required"`

	// Capabilities is a list of capabilities for the resource type.
	Capabilities []string `yaml:"capabilities" validate:"dive,capability"`
}

Jump to

Keyboard shortcuts

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