codec

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() encoding.Codec

New create codec

Types

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

Codec serializer

func (*Codec) Marshal

func (c *Codec) Marshal(v any) ([]byte, error)

Marshal serialize data

func (*Codec) Unmarshal

func (c *Codec) Unmarshal(data []byte, v any) (int, error)

Unmarshal deserialize data

type DataType

type DataType byte

DataType data type

const (
	// TypeUnknown unknown type
	TypeUnknown DataType = iota
	// TypeRaw raw data
	TypeRaw
	// TypeHTTPRequest http request data
	TypeHTTPRequest
	// TypeHTTPResponse http response data
	TypeHTTPResponse
	// TypeProtobuf protobuf data
	TypeProtobuf
)

Jump to

Keyboard shortcuts

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