encoder

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	// Encode returns the encoded/marshaled version of item
	Encode(item interface{}) ([]byte, error)
	// Decode decodes the MessagePack-encoded data and stores the result
	// in the value pointed to by v.
	Decode(data []byte, destination interface{}) error
}

Encoder represents an interface that exposes functionality to encode and decode non-numeric or boolean cache entries

type JSON

type JSON struct{}

JSON is an Encoder implementation for the encoding/json package

func (JSON) Decode

func (JSON) Decode(data []byte, dest interface{}) error

Decode implementation of the Encoder interface

func (JSON) Encode

func (JSON) Encode(item interface{}) ([]byte, error)

Encode implementation of the Encoder interface

type Msgpack

type Msgpack struct{}

Msgpack is an Encoder implementation for the msgpack package. To learn more about msgpack please see: https://msgpack.uptrace.dev

func (Msgpack) Decode

func (Msgpack) Decode(data []byte, dest interface{}) error

Decode implementation of the Encoder interface

func (Msgpack) Encode

func (Msgpack) Encode(item interface{}) ([]byte, error)

Encode implementation of the Encoder interface

Jump to

Keyboard shortcuts

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