codec

package
v0.0.0-...-69e945d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewCodecFuncMap map[Type]NewCodecFunc

Functions

This section is empty.

Types

type Codec

type Codec interface {
	io.Closer
	ReadHeader(header *Header) error
	ReadBody(interface{}) error
	Write(*Header, interface{}) error
}

func NewGobCodec

func NewGobCodec(conn io.ReadWriteCloser) Codec

type GobCodec

type GobCodec struct {
	// contains filtered or unexported fields
}
type Header struct {
	ServiceMethod string //format "Service.Method"
	Seq           uint64 //sequence number chosen by client
	Error         string
}

type NewCodecFunc

type NewCodecFunc func(closer io.ReadWriteCloser) Codec

type Type

type Type string
const (
	GobType  Type = "application/gob"
	JsonType Type = "application/json" //not implemented
)

Jump to

Keyboard shortcuts

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