encoding

package
v0.0.0-...-a3eedf2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct{}

func (*Block) Marshalling

func (b *Block) Marshalling(ct *Content) ([]byte, error)

Serialize the Content struct to raw bytes

func (*Block) Unmarshalling

func (b *Block) Unmarshalling(conn io.Reader, ct *Content) error

Decode the raw bytes (TCP stream) to Content struct

type Content

type Content struct {
	Type ZContentType
	Len  uint64
	Data []byte
}

func ContentInit

func ContentInit(t ZContentType, d []byte) *Content

type ZBlock

type ZBlock interface {
	Marshalling(*Content) ([]byte, error)
	Unmarshalling(io.Reader, *Content) error
}

func BlockInit

func BlockInit() ZBlock

type ZContentType

type ZContentType uint64

Jump to

Keyboard shortcuts

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