runtime

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	// Decode attempts to deserialize the provided bytes into the provided object.
	Decode(data []byte, defaults *string, into Object) (Object, *string, error)
}

Decoder knows how to decode an object from a stream.

type Encoder

type Encoder interface {
	// Encode writes a set of objects to a stream.
	Encode(obj Object, w io.Writer) error
}

Encoder knows how to encode an object into a stream.

type Framer

type Framer interface {
	// NewFrameReader returns a Reader that wraps the provided Reader,
	NewFrameReader(r io.ReadCloser) io.ReadCloser
	// NewFrameWriter returns a Writer that wraps the provided Writer.
	NewFrameWriter(w io.Writer) io.Writer
}

Framer knows how to wrap and unwrap a stream of data.

type Object

type Object interface {
	// GetObjectKind returns the kind of object, as represented by the ObjectKind
	GetObjectKind() schema.ObjectKind
	// DeepCopyObject returns a copy of the object.
	DeepCopyObject() Object
}

Object is an object that has an ObjectKind.

func UseOrCreateObject

func UseOrCreateObject(t ObjectTyper, c ObjectCreator, kind string, obj Object) (Object, error)

type ObjectCreator

type ObjectCreator interface {
	// New returns a new object of the provided kind.
	New(kind string) (out Object, err error)
}

ObjectCreator knows how to create an object.

type ObjectTyper

type ObjectTyper interface {
	// ObjectKind returns the kind of the provided object.
	ObjectKind(Object) (string, error)
	// Recognizes returns true if the provided kind is known to this typer.
	Recognizes(kind string) bool
}

ObjectTyper knows how to get the kind of an object.

type Scheme

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

func NewScheme

func NewScheme() *Scheme

func (*Scheme) AddKnownTypeWithName

func (s *Scheme) AddKnownTypeWithName(kind string, obj Object)

func (*Scheme) AllKnownTypes

func (s *Scheme) AllKnownTypes() map[string]reflect.Type

AllKnownTypes returns the all known types.

func (*Scheme) New

func (s *Scheme) New(kind string) (Object, error)

func (*Scheme) ObjectKind

func (s *Scheme) ObjectKind(obj Object) (string, error)

func (*Scheme) Recognizes

func (s *Scheme) Recognizes(kind string) bool

type SchemeBuilder

type SchemeBuilder []func(*Scheme) error

func NewSchemeBuilder

func NewSchemeBuilder(funcs ...func(*Scheme) error) SchemeBuilder

NewSchemeBuilder calls Register for you.

func (*SchemeBuilder) AddToScheme

func (sb *SchemeBuilder) AddToScheme(s *Scheme) error

AddToScheme applies all the stored functions to the scheme. A non-nil error indicates that one function failed and the attempt was abandoned.

func (*SchemeBuilder) Register

func (sb *SchemeBuilder) Register(funcs ...func(*Scheme) error)

Register adds a scheme setup function to the list.

type Serializer

type Serializer interface {
	// Encoder knows how to serialize an object.
	Encoder
	// Decoder knows how to deserialize an object.
	Decoder
}

Serializer knows how to serialize and deserialize objects.

Directories

Path Synopsis
serializer

Jump to

Keyboard shortcuts

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