gobber

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: GPL-3.0-or-later Imports: 2 Imported by: 0

Documentation

Overview

Package gobber implements a buffer based datagram oriented gob coder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gobber

type Gobber struct {
	// contains filtered or unexported fields
}

A gob encoder and decoder for datagram messages.

func New

func New() *Gobber

Creates and returns a new gobber.

func (*Gobber) Decode

func (g *Gobber) Decode(data []byte, msg interface{}) error

Decodes the source data assembling the requested message.

func (*Gobber) Encode

func (g *Gobber) Encode(msg interface{}) ([]byte, error)

Encodes a message and returns a reference to the output buffer. The caller is responsible for copying the slice contents before the next call!

func (*Gobber) Init

func (g *Gobber) Init(msg interface{}) error

Initializes the internal gob state to handle messages of the given type.

Jump to

Keyboard shortcuts

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