codec

package
v0.0.0-...-45fcff9 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

purpose: 序列化和反序列化 author: nash date: 2023/11/23

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Encode(i interface{}) ([]byte, error)
	Decode(data []byte, i interface{}) error
}

type GobCodec

type GobCodec struct {
}

func (GobCodec) Decode

func (t GobCodec) Decode(data []byte, i interface{}) error

func (GobCodec) Encode

func (t GobCodec) Encode(i interface{}) ([]byte, error)

type JsonCodec

type JsonCodec struct {
}

purpose: json序列化和反序列化

func (JsonCodec) Decode

func (t JsonCodec) Decode(data []byte, i interface{}) error

func (JsonCodec) Encode

func (t JsonCodec) Encode(i interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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