marshaller

package
v1.3.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxNumberOfObjectsToSerialize = 1000

Arbitrarily choosing 1000 jobs to serialize - this is a pretty high

View Source
const MaxSerializedStringInput = int(10 * datasize.MB)

Variables

This section is empty.

Functions

func ConfirmMaxSliceSize

func ConfirmMaxSliceSize[T any](t T, maxSize int) error

func JSONMarshalIndentWithMax

func JSONMarshalIndentWithMax[T any](t T, indentSpaces int) ([]byte, error)

func JSONMarshalWithMax

func JSONMarshalWithMax[T any](t T) ([]byte, error)

func JSONUnmarshalWithMax

func JSONUnmarshalWithMax[T any](b []byte, t *T) error

func YAMLMarshalWithMax

func YAMLMarshalWithMax[T any](t T) ([]byte, error)

func YAMLUnmarshalWithMax

func YAMLUnmarshalWithMax[T any](b []byte, t *T) error

Types

type BinaryMarshaller added in v1.1.2

type BinaryMarshaller struct{}

BinaryMarshaller uses gob encoding for marshaling.

func NewBinaryMarshaller added in v1.1.2

func NewBinaryMarshaller() *BinaryMarshaller

NewBinaryMarshaller initializes and returns a new BinaryMarshaller.

func (BinaryMarshaller) Marshal added in v1.1.2

func (BinaryMarshaller) Marshal(obj interface{}) ([]byte, error)

Marshal converts the given object into a gob-encoded byte slice.

func (BinaryMarshaller) Unmarshal added in v1.1.2

func (BinaryMarshaller) Unmarshal(data []byte, obj interface{}) error

Unmarshal decodes gob data into the given object.

type JSONMarshaller added in v1.1.2

type JSONMarshaller struct{}

JSONMarshaller uses JSON encoding for marshaling.

func NewJSONMarshaller added in v1.1.2

func NewJSONMarshaller() *JSONMarshaller

NewJSONMarshaller initializes and returns a new JSONMarshaller.

func (JSONMarshaller) Marshal added in v1.1.2

func (JSONMarshaller) Marshal(obj interface{}) ([]byte, error)

Marshal converts the given object into a JSON byte slice.

func (JSONMarshaller) Unmarshal added in v1.1.2

func (JSONMarshaller) Unmarshal(data []byte, obj interface{}) error

Unmarshal decodes JSON data into the given object and normalizes it if applicable.

type KeyInt

type KeyInt int

type KeyString

type KeyString string

type Marshaller added in v1.1.2

type Marshaller interface {
	// Marshal converts the given object into a byte slice.
	Marshal(interface{}) ([]byte, error)
	// Unmarshal decodes data into the given object, and normalizes it if applicable.
	Unmarshal([]byte, interface{}) error
}

Marshaller defines methods for marshaling and unmarshaling data, and normalizing it if applicable.

Jump to

Keyboard shortcuts

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