codec

package
v0.0.0-...-9e1c66b Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 4 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) 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
}

func (*GobCodec) Close

func (c *GobCodec) Close() error

func (*GobCodec) ReadBody

func (c *GobCodec) ReadBody(body interface{}) error

func (*GobCodec) ReadHeader

func (c *GobCodec) ReadHeader(h *Header) error

func (*GobCodec) Write

func (c *GobCodec) Write(h *Header, body interface{}) (err error)
type Header struct {
	ServiceMethod string // format "Service.Method"
	Seq           uint64 // sequence number chosen by client
	Error         string
}

type NewCodecFunc

type NewCodecFunc func(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