proto

package
v0.0.0-...-3ef95a7 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2015 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNil = errors.New("Can't parse packet into nil")
View Source
var ErrPayload = errors.New("Invalid format of Payload.")
View Source
var ErrShortBuf = errors.New("Buffer too short.")
View Source
var ErrType = errors.New("Invalid frame type.")

Functions

func ReadBytes

func ReadBytes(buf []byte) (b []byte, lft []byte, err error)

func ReadString

func ReadString(buf []byte) (s string, lft []byte, err error)

func WriteBytes

func WriteBytes(buf []byte, b []byte) (lft []byte, err error)

func WriteString

func WriteString(buf []byte, s string) (lft []byte, err error)

Types

type RawPacket

type RawPacket struct {
	Frametype uint16
	Payload   []byte
	Signature *[ed25519.SignatureSize]byte
}

func NewPacket

func NewPacket(frametype uint16, payload []byte) *RawPacket

func ReadPacket

func ReadPacket(reader io.Reader) (pkt *RawPacket, err error)

func (*RawPacket) Bytes

func (p *RawPacket) Bytes() []byte

func (*RawPacket) Sign

func (p *RawPacket) Sign(privk *[ed25519.PrivateKeySize]byte)

func (*RawPacket) Validate

func (p *RawPacket) Validate(pubk *[ed25519.PublicKeySize]byte) bool

Jump to

Keyboard shortcuts

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