codec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes struct{}

Bytes codec is

func (*Bytes) Decode

func (d *Bytes) Decode(data []byte) (interface{}, error)

Decode of defaultCodec simply returns the data

func (*Bytes) Encode

func (d *Bytes) Encode(value interface{}) ([]byte, error)

Encode does a type conversion into []byte

type Int64

type Int64 struct{}

Int64 is a commonly used codec to encode and decode string <-> []byte

func (*Int64) Decode

func (c *Int64) Decode(data []byte) (interface{}, error)

Decode decodes from []byte to string

func (*Int64) Encode

func (c *Int64) Encode(value interface{}) ([]byte, error)

Encode encodes from string to []byte

type String

type String struct{}

String is a commonly used codec to encode and decode string <-> []byte

func (*String) Decode

func (c *String) Decode(data []byte) (interface{}, error)

Decode decodes from []byte to string

func (*String) Encode

func (c *String) Encode(value interface{}) ([]byte, error)

Encode encodes from string to []byte

Jump to

Keyboard shortcuts

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