msg

package
v0.0.0-...-c704384 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2014 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package msg is 100% generated. If you edit this file, you will lose your changes at the next build cycle. DO NOT MAKE ANY CHANGES YOU WISH TO KEEP.

The correct places for commits are:

  • The XML model used for this code generation: zre_msg.xml
  • The code generation script that built this file: zproto_codec_go

Index

Constants

View Source
const (
	HelloId   uint8 = 1
	WhisperId uint8 = 2
	ShoutId   uint8 = 3
	JoinId    uint8 = 4
	LeaveId   uint8 = 5
	PingId    uint8 = 6
	PingOkId  uint8 = 7
)
View Source
const (
	Signature uint16 = 0xAAA0 | 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hello

type Hello struct {
	Endpoint string
	Groups   []string
	Status   byte
	Name     string
	Headers  map[string]string
	// contains filtered or unexported fields
}

Greet a peer so it can connect back to us

func NewHello

func NewHello() *Hello

New creates new Hello message.

func (*Hello) Marshal

func (h *Hello) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Hello) RoutingId

func (h *Hello) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Hello) Send

func (h *Hello) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*Hello) Sequence

func (h *Hello) Sequence() uint16

sequence returns the sequence.

func (*Hello) SetRoutingId

func (h *Hello) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Hello) SetSequence

func (h *Hello) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*Hello) SetVersion

func (h *Hello) SetVersion(version byte)

Setversion sets the version.

func (*Hello) String

func (h *Hello) String() string

String returns print friendly name.

func (*Hello) Unmarshal

func (h *Hello) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*Hello) Version

func (h *Hello) Version() byte

version returns the version.

type Join

type Join struct {
	Group  string
	Status byte
	// contains filtered or unexported fields
}

Join a group

func NewJoin

func NewJoin() *Join

New creates new Join message.

func (*Join) Marshal

func (j *Join) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Join) RoutingId

func (j *Join) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Join) Send

func (j *Join) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*Join) Sequence

func (j *Join) Sequence() uint16

sequence returns the sequence.

func (*Join) SetRoutingId

func (j *Join) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Join) SetSequence

func (j *Join) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*Join) SetVersion

func (j *Join) SetVersion(version byte)

Setversion sets the version.

func (*Join) String

func (j *Join) String() string

String returns print friendly name.

func (*Join) Unmarshal

func (j *Join) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*Join) Version

func (j *Join) Version() byte

version returns the version.

type Leave

type Leave struct {
	Group  string
	Status byte
	// contains filtered or unexported fields
}

Leave a group

func NewLeave

func NewLeave() *Leave

New creates new Leave message.

func (*Leave) Marshal

func (l *Leave) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Leave) RoutingId

func (l *Leave) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Leave) Send

func (l *Leave) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*Leave) Sequence

func (l *Leave) Sequence() uint16

sequence returns the sequence.

func (*Leave) SetRoutingId

func (l *Leave) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Leave) SetSequence

func (l *Leave) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*Leave) SetVersion

func (l *Leave) SetVersion(version byte)

Setversion sets the version.

func (*Leave) String

func (l *Leave) String() string

String returns print friendly name.

func (*Leave) Unmarshal

func (l *Leave) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*Leave) Version

func (l *Leave) Version() byte

version returns the version.

type Ping

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

Ping a peer that has gone silent

func NewPing

func NewPing() *Ping

New creates new Ping message.

func (*Ping) Marshal

func (p *Ping) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Ping) RoutingId

func (p *Ping) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Ping) Send

func (p *Ping) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*Ping) Sequence

func (p *Ping) Sequence() uint16

sequence returns the sequence.

func (*Ping) SetRoutingId

func (p *Ping) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Ping) SetSequence

func (p *Ping) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*Ping) SetVersion

func (p *Ping) SetVersion(version byte)

Setversion sets the version.

func (*Ping) String

func (p *Ping) String() string

String returns print friendly name.

func (*Ping) Unmarshal

func (p *Ping) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*Ping) Version

func (p *Ping) Version() byte

version returns the version.

type PingOk

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

Reply to a peer's ping

func NewPingOk

func NewPingOk() *PingOk

New creates new PingOk message.

func (*PingOk) Marshal

func (p *PingOk) Marshal() ([]byte, error)

Marshal serializes the message.

func (*PingOk) RoutingId

func (p *PingOk) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*PingOk) Send

func (p *PingOk) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*PingOk) Sequence

func (p *PingOk) Sequence() uint16

sequence returns the sequence.

func (*PingOk) SetRoutingId

func (p *PingOk) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*PingOk) SetSequence

func (p *PingOk) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*PingOk) SetVersion

func (p *PingOk) SetVersion(version byte)

Setversion sets the version.

func (*PingOk) String

func (p *PingOk) String() string

String returns print friendly name.

func (*PingOk) Unmarshal

func (p *PingOk) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*PingOk) Version

func (p *PingOk) Version() byte

version returns the version.

type Shout

type Shout struct {
	Group   string
	Content []byte
	// contains filtered or unexported fields
}

Send a multi-part message to a group

func NewShout

func NewShout() *Shout

New creates new Shout message.

func (*Shout) Marshal

func (s *Shout) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Shout) RoutingId

func (s *Shout) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Shout) Send

func (s *Shout) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*Shout) Sequence

func (s *Shout) Sequence() uint16

sequence returns the sequence.

func (*Shout) SetRoutingId

func (s *Shout) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Shout) SetSequence

func (s *Shout) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*Shout) SetVersion

func (s *Shout) SetVersion(version byte)

Setversion sets the version.

func (*Shout) String

func (s *Shout) String() string

String returns print friendly name.

func (*Shout) Unmarshal

func (s *Shout) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*Shout) Version

func (s *Shout) Version() byte

version returns the version.

type Transit

type Transit interface {
	Marshal() ([]byte, error)
	Unmarshal(...[]byte) error
	String() string
	Send(*zmq.Socket) error
	SetRoutingId([]byte)
	RoutingId() []byte
	SetVersion(byte)
	Version() byte
	SetSequence(uint16)
	Sequence() uint16
}

func Clone

func Clone(t Transit) Transit

Clones a message.

func Recv

func Recv(socket *zmq.Socket) (t Transit, err error)

Receives marshaled data from 0mq socket.

func RecvNoWait

func RecvNoWait(socket *zmq.Socket) (t Transit, err error)

Receives marshaled data from 0mq socket. It won't wait for input.

func Unmarshal

func Unmarshal(frames ...[]byte) (t Transit, err error)

Unmarshals data from raw frames.

type Whisper

type Whisper struct {
	Content []byte
	// contains filtered or unexported fields
}

Send a multi-part message to a peer

func NewWhisper

func NewWhisper() *Whisper

New creates new Whisper message.

func (*Whisper) Marshal

func (w *Whisper) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Whisper) RoutingId

func (w *Whisper) RoutingId() []byte

RoutingId returns the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Whisper) Send

func (w *Whisper) Send(socket *zmq.Socket) (err error)

Sends marshaled data through 0mq socket.

func (*Whisper) Sequence

func (w *Whisper) Sequence() uint16

sequence returns the sequence.

func (*Whisper) SetRoutingId

func (w *Whisper) SetRoutingId(routingId []byte)

SetRoutingId sets the routingId for this message, routingId should be set whenever talking to a ROUTER.

func (*Whisper) SetSequence

func (w *Whisper) SetSequence(sequence uint16)

Setsequence sets the sequence.

func (*Whisper) SetVersion

func (w *Whisper) SetVersion(version byte)

Setversion sets the version.

func (*Whisper) String

func (w *Whisper) String() string

String returns print friendly name.

func (*Whisper) Unmarshal

func (w *Whisper) Unmarshal(frames ...[]byte) error

Unmarshals the message.

func (*Whisper) Version

func (w *Whisper) Version() byte

version returns the version.

Jump to

Keyboard shortcuts

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