buf

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package buf

Package buf

Package buf

Fushin Buf 基于gob的仅使用与go的进程间交互编码

Package buf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckReg

func CheckReg(d interface{}) bool

func Decode

func Decode(b []byte, d interface{}) error

Decode d 需要是一个指针接收体

func Encode

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

func List

func List() map[interface{}]struct{}

func Reg

func Reg(d interface{})

Reg 注册结构体

Types

type Buf

type Buf struct {
}

Buf 实现FushinBuf接口的结构体可以直接使用encode编码

func (*Buf) Calc

func (b *Buf) Calc() int

Calc 计算字节流长度

func (*Buf) Decode

func (b *Buf) Decode(data []byte) error

Decode 从data数据中解码到b *Buf

func (*Buf) Encode

func (b *Buf) Encode() ([]byte, error)

Encode 从b实例中编码为字节流

type FushinBuf

type FushinBuf interface {
	Encode() ([]byte, error)
	Decode(data []byte) error
	Calc() int
}

Jump to

Keyboard shortcuts

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