msg

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

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

Go to latest
Published: Nov 2, 2014 License: MPL-2.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: zgossip_msg.xml
  • The code generation script that built this file: zproto_codec_goczmq

Index

Constants

View Source
const (
	HelloId   uint8 = 1
	PublishId uint8 = 2
	PingId    uint8 = 3
	PongId    uint8 = 4
	InvalidId uint8 = 5
)
View Source
const (
	Signature uint16 = 0xAAA0 | 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hello

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

Client says hello to server

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(sock *goczmq.Sock) (err error)

Send sends marshaled data through 0mq socket.

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

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

Server rejects command as invalid

func NewInvalid

func NewInvalid() *Invalid

New creates new Invalid message.

func (*Invalid) Marshal

func (i *Invalid) Marshal() ([]byte, error)

Marshal serializes the message.

func (*Invalid) RoutingId

func (i *Invalid) RoutingId() []byte

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

func (*Invalid) Send

func (i *Invalid) Send(sock *goczmq.Sock) (err error)

Send sends marshaled data through 0mq socket.

func (*Invalid) SetRoutingId

func (i *Invalid) SetRoutingId(routingId []byte)

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

func (*Invalid) SetVersion

func (i *Invalid) SetVersion(version byte)

Setversion sets the version.

func (*Invalid) String

func (i *Invalid) String() string

String returns print friendly name.

func (*Invalid) Unmarshal

func (i *Invalid) Unmarshal(frames ...[]byte) error

Unmarshal unmarshals the message.

func (*Invalid) Version

func (i *Invalid) Version() byte

version returns the version.

type Ping

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

Client signals liveness

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(sock *goczmq.Sock) (err error)

Send sends marshaled data through 0mq socket.

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

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

Server responds to ping; note that pongs are not correlated with pings,

func NewPong

func NewPong() *Pong

New creates new Pong message.

func (*Pong) Marshal

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

Marshal serializes the message.

func (*Pong) RoutingId

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

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

func (*Pong) Send

func (p *Pong) Send(sock *goczmq.Sock) (err error)

Send sends marshaled data through 0mq socket.

func (*Pong) SetRoutingId

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

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

func (*Pong) SetVersion

func (p *Pong) SetVersion(version byte)

Setversion sets the version.

func (*Pong) String

func (p *Pong) String() string

String returns print friendly name.

func (*Pong) Unmarshal

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

Unmarshal unmarshals the message.

func (*Pong) Version

func (p *Pong) Version() byte

version returns the version.

type Publish

type Publish struct {
	Key   string
	Value string
	Ttl   uint32
	// contains filtered or unexported fields
}

Client or server announces a new tuple

func NewPublish

func NewPublish() *Publish

New creates new Publish message.

func (*Publish) Marshal

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

Marshal serializes the message.

func (*Publish) RoutingId

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

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

func (*Publish) Send

func (p *Publish) Send(sock *goczmq.Sock) (err error)

Send sends marshaled data through 0mq socket.

func (*Publish) SetRoutingId

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

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

func (*Publish) SetVersion

func (p *Publish) SetVersion(version byte)

Setversion sets the version.

func (*Publish) String

func (p *Publish) String() string

String returns print friendly name.

func (*Publish) Unmarshal

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

Unmarshal unmarshals the message.

func (*Publish) Version

func (p *Publish) Version() byte

version returns the version.

type Transit

type Transit interface {
	Marshal() ([]byte, error)
	Unmarshal(...[]byte) error
	String() string
	Send(*goczmq.Sock) error
	SetRoutingId([]byte)
	RoutingId() []byte
	SetVersion(byte)
	Version() byte
}

Transit is a codec interface

func Clone

func Clone(t Transit) Transit

Clone clones a message.

func Recv

func Recv(sock *goczmq.Sock) (t Transit, err error)

Recv receives marshaled data from a 0mq socket.

func RecvNoWait

func RecvNoWait(sock *goczmq.Sock) (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.

Jump to

Keyboard shortcuts

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