msg

package
v0.0.0-...-8b31643 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: ISC Imports: 4 Imported by: 0

Documentation

Overview

Package msg is all the wire types and their packing.

Index

Constants

View Source
const (
	OVtErrType = iota // illegal
	OVtRootType
	OVtDirType
	OVtPointerType0
	OVtPointerType1
	OVtPointerType2
	OVtPointerType3
	OVtPointerType4
	OVtPointerType5
	OVtPointerType6
	OVtPointerType7 // not used
	OVtPointerType8 // not used
	OVtPointerType9 // not used
	OVtDataType
)
View Source
const (
	VtDataType = iota << 3
	VtDirType
	VtRootType
	VtCorruptType = 0xFF
)
View Source
const (
	KindRerror uint8
	KindTping
	KindRping
	KindThello
	KindRhello
	KindTgoodbye
	KindRgoodbye /* not used */
	KindTauth0   /* auth messages not implemented */
	KindRauth0   /* auth messages not implemented */
	KindTauth1   /* auth messages not implemented */
	KindRauth1   /* auth messages not implemented */
	KindTread
	KindRread
	KindTwrite
	KindRwrite
	KindTsync
	KindRsync
	KindTmax
)

These are a bunch of constants for message types.

Variables

View Source
var ErrBufTooSmall = fmt.Errorf("msg: destination buffer too small")

ErrBufTooSmall is returned when a buffer is too small for a message to write itself into.

Functions

This section is empty.

Types

type Rerror

type Rerror struct {
	Tag byte
	Err string
}

Rerror is VtRerror.

func (*Rerror) Error

func (m *Rerror) Error() string

func (*Rerror) Read

func (m *Rerror) Read(b []byte) (int, error)

func (*Rerror) String

func (m *Rerror) String() string

func (*Rerror) Write

func (m *Rerror) Write(b []byte) (int, error)

type Rhello

type Rhello struct {
	Tag    byte
	SID    string
	Crypto byte
	Codec  byte
}

Rhello is the server response to Thello. It completes the venti handshake.

func (*Rhello) Read

func (m *Rhello) Read(b []byte) (int, error)

func (*Rhello) String

func (m *Rhello) String() string

func (*Rhello) Write

func (m *Rhello) Write(b []byte) (int, error)

type Rping

type Rping struct {
	Tag byte
}

Rping is the ping response.

func (*Rping) Read

func (m *Rping) Read(b []byte) (int, error)

func (*Rping) String

func (m *Rping) String() string

func (*Rping) Write

func (m *Rping) Write(b []byte) (int, error)

type Rread

type Rread struct {
	Tag  byte
	Data io.Reader
	// contains filtered or unexported fields
}

Rread is VtRread.

func (*Rread) Read

func (m *Rread) Read(b []byte) (int, error)

func (*Rread) String

func (m *Rread) String() string

func (*Rread) Write

func (m *Rread) Write(b []byte) (int, error)

type Rsync

type Rsync struct {
	Tag byte
}

Rsync is VtRsync.

func (*Rsync) Read

func (m *Rsync) Read(b []byte) (int, error)

func (*Rsync) String

func (m *Rsync) String() string

func (*Rsync) Write

func (m *Rsync) Write(b []byte) (int, error)

type Rwrite

type Rwrite struct {
	Tag   byte
	Score []byte
}

Rwrite is VtRwrite.

func (*Rwrite) Read

func (m *Rwrite) Read(b []byte) (int, error)

func (*Rwrite) String

func (m *Rwrite) String() string

func (*Rwrite) UnmarshalBinary

func (m *Rwrite) UnmarshalBinary(b []byte) error

func (*Rwrite) Write

func (m *Rwrite) Write(b []byte) (int, error)

type Tgoodbye

type Tgoodbye struct {
	Tag byte
}

Tgoodbye is VtTgoodbye.

func (*Tgoodbye) Read

func (m *Tgoodbye) Read(b []byte) (int, error)

func (*Tgoodbye) String

func (m *Tgoodbye) String() string

func (*Tgoodbye) Write

func (m *Tgoodbye) Write(b []byte) (int, error)

type Thello

type Thello struct {
	Tag     byte
	Version string
	UID     string
	Strong  byte
	Crypto  []byte
	Codec   []byte
}

Thello initiates the handshake.

Cribbing from the venti(7) manpage:

Venti connections must begin with a hello transaction.  The
VtThello message contains the protocol version that the
client has chosen to use.  The fields strength, crypto, and
codec could be used to add authentication, encryption, and
compression to the Venti session but are currently ignored.
The rcrypto, and rcodec fields in the VtRhello response are
similarly ignored.  The uid and sid fields are intended to
be the identity of the client and server but, given the lack
of authentication, should be treated only as advisory.  The
initial hello should be the only hello transaction during
the session.

func (*Thello) Read

func (m *Thello) Read(b []byte) (int, error)

func (*Thello) String

func (m *Thello) String() string

func (*Thello) Write

func (m *Thello) Write(b []byte) (int, error)

type Tping

type Tping struct {
	Tag byte
}

Tping is the client pinging the server.

The ping message has no effect and is used mainly for debug-
ging.  Servers should respond immediately to pings.

func (*Tping) Read

func (m *Tping) Read(b []byte) (int, error)

func (*Tping) String

func (m *Tping) String() string

func (*Tping) Write

func (m *Tping) Write(b []byte) (int, error)

type Tread

type Tread struct {
	Tag   byte
	Score []byte
	Type  byte
	Pad   byte
	Count uint32
}

Tread is VtTread.

func (*Tread) Read

func (m *Tread) Read(b []byte) (int, error)

func (*Tread) String

func (m *Tread) String() string

func (*Tread) Write

func (m *Tread) Write(b []byte) (int, error)

type Tsync

type Tsync struct {
	Tag byte
}

Tsync is VtTsync.

func (*Tsync) Read

func (m *Tsync) Read(b []byte) (int, error)

func (*Tsync) String

func (m *Tsync) String() string

func (*Tsync) Write

func (m *Tsync) Write(b []byte) (int, error)

type Twrite

type Twrite struct {
	Tag  byte
	Type byte
	Pad  [3]byte
}

Twrite is VtTwrite.

func (*Twrite) Read

func (m *Twrite) Read(b []byte) (int, error)

func (*Twrite) String

func (m *Twrite) String() string

func (*Twrite) Write

func (m *Twrite) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

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