codec

package
v0.33.9 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 0 Imported by: 6

Documentation

Overview

Package codec 消息的编码与解码,支持 json、protobuf,默认 json 格式

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	// Marshal 将数据转为 []byte
	Marshal(in interface{}) ([]byte, error)

	// Unmarshal 将 []byte 转为数据
	Unmarshal(in []byte, out interface{}) error

	// Name 名称
	Name() string

	// MimeType 媒体类型
	MimeType() string
}

Codec 编码与解码器

Directories

Path Synopsis
Package protobuf 谷歌官方实现
Package protobuf 谷歌官方实现

Jump to

Keyboard shortcuts

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