network

package
v0.0.0-...-bc3f6f8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterEncoding

type CounterEncoding struct {
	*sync.RWMutex
	Encoding
	// contains filtered or unexported fields
}

CounterEncoding is a wrapper around an Encoding that can report how many bytes sent and received and implements the monitor.Counter interface

func NewCounterEncoding

func NewCounterEncoding(e Encoding) *CounterEncoding

NewCounterEncoding returns an Encoding that implements the monitor.Counter interface

func (*CounterEncoding) Decode

func (c *CounterEncoding) Decode(r io.Reader) (*handel.Packet, error)

Decode implements the Encoding interface

func (*CounterEncoding) Encode

func (c *CounterEncoding) Encode(p *handel.Packet, w io.Writer) error

Encode implements the Encoding interface

func (*CounterEncoding) Values

func (c *CounterEncoding) Values() map[string]float64

Values implements the monitor.Counter interface

type Encoding

type Encoding interface {
	Encode(*h.Packet, io.Writer) error
	Decode(r io.Reader) (*h.Packet, error)
}

Encoding abstract the wire encoding format

func NewGOBEncoding

func NewGOBEncoding() Encoding

NewGOBEncoding crates instance of Encoding interface backed by gob

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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