cbor

package
v0.32.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFramer added in v0.31.0

func NewFramer() runtime.Framer

NewFramer returns a runtime.Framer based on RFC 8742 CBOR Sequences. Each frame contains exactly one encoded CBOR data item.

func NewSerializerInfo added in v0.32.0

func NewSerializerInfo(creater runtime.ObjectCreater, typer runtime.ObjectTyper) runtime.SerializerInfo

NewSerializerInfo returns a default SerializerInfo for CBOR using the given creater and typer.

Types

type Option

type Option func(*options)

func Strict

func Strict(s bool) Option

Strict configures a serializer to return a strict decoding error when it encounters map keys that do not correspond to a field in the target object of a decode operation. This option is disabled by default.

func Transcode added in v0.32.0

func Transcode(s bool) Option

Transcode configures a serializer to transcode the "raw" bytes of a decoded runtime.RawExtension or metav1.FieldsV1 object to JSON. This is enabled by default to support existing programs that depend on the assumption that objects of either type contain valid JSON.

type Serializer

type Serializer interface {
	runtime.Serializer
	runtime.NondeterministicEncoder
	recognizer.RecognizingDecoder
	// contains filtered or unexported methods
}

func NewSerializer

func NewSerializer(creater runtime.ObjectCreater, typer runtime.ObjectTyper, options ...Option) Serializer

NewSerializer creates and returns a serializer configured with the provided options. The default options are equivalent to explicitly passing Strict(false) and Transcode(true).

Directories

Path Synopsis
Package direct provides functions for marshaling and unmarshaling between arbitrary Go values and CBOR data, with behavior that is compatible with that of the CBOR serializer.
Package direct provides functions for marshaling and unmarshaling between arbitrary Go values and CBOR data, with behavior that is compatible with that of the CBOR serializer.
internal

Jump to

Keyboard shortcuts

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