resource

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorKindIsReservedWord is the error returned when a resource kind is a reserved word.
	ErrorKindIsReservedWord = Error("resource kind is a reserved word")
)

Variables

This section is empty.

Functions

func KindIsReservedWord

func KindIsReservedWord(kind string) bool

KindIsReservedWord returns true if the kind is a reserved word.

Types

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Resource

type Resource struct {
	// Kind is the kind of the resource.
	Kind string `json:"kind" yaml:"kind"`
	// Name is the name of the resource.
	Name string `json:"name" yaml:"name"`
	// Description is the description of the resource.
	Description string `json:"description" yaml:"description"`
	// Owner is the owner of the resource.
	Owner string `json:"owner" yaml:"owner"`
	// Data is the data of the resource.
	Data interface{} `json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

Resource is a resource.

func Load

func Load(r io.Reader) ([]*Resource, error)

Load loads a manifest from a reader.

func LoadFile

func LoadFile(path string) ([]*Resource, error)

LoadFile loads a manifest.

func New

func New(kind, name, description, owner string) (*Resource, error)

New returns a new resource.

func (*Resource) MarshalJSON

func (r *Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Resource) MarshalYAML

func (r *Resource) MarshalYAML() (interface{}, error)

MarshalYAML implements the yaml.Marshaler interface.

func (*Resource) UnmarshalJSON

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*Resource) UnmarshalYAML

func (r *Resource) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Jump to

Keyboard shortcuts

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