message

package
v0.0.0-...-e3ab1ac Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloseFlag, when set on a Data message, indicates that the flow
	// should be closed after the payload for that message has been
	// processed.
	CloseFlag = 1 << iota
	// DisableEncryptionFlag, when set on a Data message, causes Append
	// and Read to behave specially.  During Append everything but the
	// Payload is serialized normally, but the Payload is left for the
	// caller to deal with.  Typically the caller will encrypt the
	// serialized result and send the unencrypted bytes as a raw follow
	// on message.  Read will expect to not find a payload, and the
	// caller will typically attach it by examining the next message on
	// the Conn.
	DisableEncryptionFlag
	// SideChannelFlag, when set on a OpenFlow message, marks the Flow
	// as a side channel. This means that the flow will not be counted
	// towards the "idleness" of the underlying connection.
	SideChannelFlag
)

data flags.

Variables

View Source
var (
	ErrInvalidMsg         = verror.Register("v.io/v23/flow/message.InvalidMsg", verror.NoRetry, "{1:}{2:} message of type {3} and size {4} failed decoding at field {5}{:6}.")
	ErrInvalidSetupOption = verror.Register("v.io/v23/flow/message.InvalidSetupOption", verror.NoRetry, "{1:}{2:} setup option{:3} failed decoding at field{:4}.")
	ErrUnknownMsg         = verror.Register("v.io/v23/flow/message.UnknownMsg", verror.NoRetry, "{1:}{2:} unknown message type{:3}.")
	ErrMissingBlessings   = verror.Register("v.io/v23/flow/message.MissingBlessings", verror.NoRetry, "{1:}{2:} {3} message received with no blessings.")
)

Functions

func Append

func Append(ctx *context.T, m Message, to []byte) ([]byte, error)

Append serializes the message m and appends it to the given byte slice. The resulting slice is returned, as well as any error that occurs during serialization.

func NewErrInvalidMsg

func NewErrInvalidMsg(ctx *context.T, typ byte, size uint64, field uint64, err error) error

NewErrInvalidMsg returns an error with the ErrInvalidMsg ID.

func NewErrInvalidSetupOption

func NewErrInvalidSetupOption(ctx *context.T, option uint64, field uint64) error

NewErrInvalidSetupOption returns an error with the ErrInvalidSetupOption ID.

func NewErrMissingBlessings

func NewErrMissingBlessings(ctx *context.T, typ byte) error

NewErrMissingBlessings returns an error with the ErrMissingBlessings ID.

func NewErrUnknownMsg

func NewErrUnknownMsg(ctx *context.T, typ byte) error

NewErrUnknownMsg returns an error with the ErrUnknownMsg ID.

Types

type AckLameDuck

type AckLameDuck struct{}

AckLameDuck is sent in response to an EnterLameDuck message. After this message is received no more OpenFlow messages should arrive.

type Auth

type Auth struct {
	BlessingsKey, DischargeKey uint64
	ChannelBinding             security.Signature
}

auth is used to complete the auth handshake.

type Data

type Data struct {
	ID      uint64
	Flags   uint64
	Payload [][]byte
}

Data carries encrypted data for a specific flow.

func (*Data) String

func (m *Data) String() string

type EnterLameDuck

type EnterLameDuck struct{}

EnterLameDuck is sent as notification that the sender is entering lameduck mode. The receiver should stop opening new flows on this connection and respond with an AckLameDuck message.

type HealthCheckRequest

type HealthCheckRequest struct{}

HealthCheckRequest is periodically sent to test the health of a channel.

type HealthCheckResponse

type HealthCheckResponse struct{}

HealthCheckResponse messages are sent in response to HealthCheckRequest messages.

type Message

type Message interface {
	// contains filtered or unexported methods
}

Message is implemented by all low-level messages defined by this package.

func Read

func Read(ctx *context.T, from []byte) (Message, error)

Read reads a message contained in the byte slice 'from'.

type MultiProxyRequest

type MultiProxyRequest struct{}

MultiProxyRequest is sent when a proxy wants to accept connections from another proxy.

type OpenFlow

type OpenFlow struct {
	ID                         uint64
	InitialCounters            uint64
	BlessingsKey, DischargeKey uint64
	Flags                      uint64
	Payload                    [][]byte
}

OpenFlow is sent at the beginning of every new flow, it optionally contains payload.

func (*OpenFlow) String

func (m *OpenFlow) String() string

type ProxyErrorResponse

type ProxyErrorResponse struct {
	Error string
}

ProxyErrorResponse is send by a proxy in response to a ProxyServerRequest or MultiProxyRequest if the proxy encountered an error while responding to the request. It should be sent in lieu of a ProxyResponse.

func (*ProxyErrorResponse) String

func (m *ProxyErrorResponse) String() string

type ProxyResponse

type ProxyResponse struct {
	Endpoints []naming.Endpoint
}

ProxyResponse is sent by a proxy in response to a ProxyServerRequest or MultiProxyRequest. It notifies the server of the endpoints it should publish. Or, it notifies a requesting proxy of the endpoints it accepts connections from.

func (*ProxyResponse) String

func (m *ProxyResponse) String() string

type ProxyServerRequest

type ProxyServerRequest struct{}

ProxyServerRequest is sent when a server wants to listen through a proxy.

type Release

type Release struct {
	Counters map[uint64]uint64
}

Release is sent as flows are read from locally. The counters inform remote writers that there is local buffer space available.

type Setup

type Setup struct {
	Versions           version.RPCVersionRange
	PeerNaClPublicKey  *[32]byte
	PeerRemoteEndpoint naming.Endpoint
	PeerLocalEndpoint  naming.Endpoint
	Mtu                uint64
	SharedTokens       uint64
	// contains filtered or unexported fields
}

Setup is the first message over the wire. It negotiates protocol version and encryption options for connection. New fields to Setup must be added in order of creation. i.e. the order of the fields should not be changed.

func (*Setup) String

func (m *Setup) String() string

type TearDown

type TearDown struct {
	Message string
}

TearDown is sent over the wire before a connection is closed.

func (*TearDown) String

func (m *TearDown) String() string

Jump to

Keyboard shortcuts

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