msg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 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
)

Definition of message IDs

View Source
const (
	// Signature is put into every protocol message and lets us filter bogus
	// or unknown protocols. It is a 4-bit number from 0 to 15. Use a unique value
	// for each protocol you write, at least.
	Signature uint16 = 0xAAA0 | 1
)

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
}

Hello struct Greet a peer so it can connect back to us

func NewHello

func NewHello() *Hello

NewHello 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)

Send 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

Unmarshal 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 struct Join a group

func NewJoin

func NewJoin() *Join

NewJoin 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)

Send 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

Unmarshal 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 struct Leave a group

func NewLeave

func NewLeave() *Leave

NewLeave 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)

Send 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

Unmarshal 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 struct Ping a peer that has gone silent

func NewPing

func NewPing() *Ping

NewPing 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)

Send 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

Unmarshal 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
}

PingOk struct Reply to a peer's ping

func NewPingOk

func NewPingOk() *PingOk

NewPingOk 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)

Send 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

Unmarshal 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
}

Shout struct Send a multi-part message to a group

func NewShout

func NewShout() *Shout

NewShout 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)

Send 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

Unmarshal 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
}

Transit is a codec interface

func Clone

func Clone(t Transit) Transit

Clone clones a message.

func Recv

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

Recv receives marshaled data from a 0mq socket.

func RecvNoWait

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

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

func Unmarshal

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

Unmarshal unmarshals data from raw frames.

type Whisper

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

Whisper struct Send a multi-part message to a peer

func NewWhisper

func NewWhisper() *Whisper

NewWhisper 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)

Send 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

Unmarshal 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