json

package
v1.1.33 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultMetaFactory = SimpleMetaFactory{}
View Source
var Framer = jsonFramer{}

Framer is the default JSON framing behavior, with newlines delimiting individual objects.

Functions

This section is empty.

Types

type MetaFactory

type MetaFactory interface {
	Interpret(data []byte) (*string, error)
}

type Serializer

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

Serializer handles encoding versioned objects into the proper JSON form

func NewSerializer

func NewSerializer(meta MetaFactory, creater runtime.ObjectCreator, typer runtime.ObjectTyper, pretty bool) *Serializer

func NewSerializerWithOptions

func NewSerializerWithOptions(meta MetaFactory, creater runtime.ObjectCreator, typer runtime.ObjectTyper) *Serializer

func NewYAMLSerializer

func NewYAMLSerializer(meta MetaFactory, creater runtime.ObjectCreator, typer runtime.ObjectTyper) *Serializer

func (*Serializer) Decode

func (s *Serializer) Decode(originalData []byte, gvk *string, into runtime.Object) (runtime.Object, *string, error)

func (*Serializer) Encode

func (s *Serializer) Encode(obj runtime.Object, w io.Writer) error

Encode serializes the provided object to the given writer.

func (*Serializer) RecognizesData

func (s *Serializer) RecognizesData(data []byte) (ok, unknown bool, err error)

RecognizesData implements the RecognizingDecoder interface.

type SimpleMetaFactory

type SimpleMetaFactory struct {
}

func (SimpleMetaFactory) Interpret

func (SimpleMetaFactory) Interpret(data []byte) (*string, error)

Interpret will return the APIVersion and Kind of the JSON wire-format encoding of an object, or an error.

Jump to

Keyboard shortcuts

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