Documentation ¶
Overview ¶
Package example 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: zproto_example.xml
- The code generation script that built this file: zproto_codec_go
Index ¶
- Constants
- type Binary
- func (b *Binary) Marshal() ([]byte, error)
- func (b *Binary) RoutingID() []byte
- func (b *Binary) Send(socket *zmq.Socket) (err error)
- func (b *Binary) Sequence() uint16
- func (b *Binary) SetRoutingID(routingID []byte)
- func (b *Binary) SetSequence(sequence uint16)
- func (b *Binary) String() string
- func (b *Binary) Unmarshal(frames ...[]byte) error
- type Log
- func (l *Log) Marshal() ([]byte, error)
- func (l *Log) RoutingID() []byte
- func (l *Log) Send(socket *zmq.Socket) (err error)
- func (l *Log) Sequence() uint16
- func (l *Log) SetRoutingID(routingID []byte)
- func (l *Log) SetSequence(sequence uint16)
- func (l *Log) String() string
- func (l *Log) Unmarshal(frames ...[]byte) error
- type Structures
- func (s *Structures) Marshal() ([]byte, error)
- func (s *Structures) RoutingID() []byte
- func (s *Structures) Send(socket *zmq.Socket) (err error)
- func (s *Structures) Sequence() uint16
- func (s *Structures) SetRoutingID(routingID []byte)
- func (s *Structures) SetSequence(sequence uint16)
- func (s *Structures) String() string
- func (s *Structures) Unmarshal(frames ...[]byte) error
- type Transit
- type Types
- func (t *Types) Marshal() ([]byte, error)
- func (t *Types) RoutingID() []byte
- func (t *Types) Send(socket *zmq.Socket) (err error)
- func (t *Types) Sequence() uint16
- func (t *Types) SetRoutingID(routingID []byte)
- func (t *Types) SetSequence(sequence uint16)
- func (t *Types) String() string
- func (t *Types) Unmarshal(frames ...[]byte) error
Constants ¶
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 | 0 Version = 1 )
const ( LogID uint8 = 1 StructuresID uint8 = 2 BinaryID uint8 = 3 TypesID uint8 = 4 )
Definition of message IDs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binary ¶
type Binary struct { Flags []byte PublicKey []byte Identifier []byte Address []byte Content []byte // contains filtered or unexported fields }
Binary struct Deliver a multi-part message.
func (*Binary) RoutingID ¶
RoutingID returns the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Binary) SetRoutingID ¶
SetRoutingID sets the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Binary) SetSequence ¶
SetSequence sets the sequence.
type Log ¶
type Log struct { Version uint16 Level byte Event byte Node uint16 Peer uint16 Time uint64 Host string Data string // contains filtered or unexported fields }
Log struct Log an event.
func (*Log) RoutingID ¶
RoutingID returns the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Log) SetRoutingID ¶
SetRoutingID sets the routingID for this message, routingID should be set whenever talking to a ROUTER.
type Structures ¶
type Structures struct { Aliases []string Headers map[string]string // contains filtered or unexported fields }
Structures struct This message contains a list and a hash.
func (*Structures) Marshal ¶
func (s *Structures) Marshal() ([]byte, error)
Marshal serializes the message.
func (*Structures) RoutingID ¶
func (s *Structures) RoutingID() []byte
RoutingID returns the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Structures) Send ¶
func (s *Structures) Send(socket *zmq.Socket) (err error)
Send sends marshaled data through 0mq socket.
func (*Structures) SetRoutingID ¶
func (s *Structures) SetRoutingID(routingID []byte)
SetRoutingID sets the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Structures) SetSequence ¶
func (s *Structures) SetSequence(sequence uint16)
SetSequence sets the sequence.
func (*Structures) String ¶
func (s *Structures) String() string
String returns print friendly name.
func (*Structures) Unmarshal ¶
func (s *Structures) Unmarshal(frames ...[]byte) error
Unmarshal unmarshals the message.
type Transit ¶
type Transit interface { Marshal() ([]byte, error) Unmarshal(...[]byte) error String() string Send(*zmq.Socket) error SetRoutingID([]byte) RoutingID() []byte SetSequence(uint16) Sequence() uint16 }
Transit is a codec interface
func RecvNoWait ¶
RecvNoWait receives marshaled data from 0mq socket. It won't wait for input.
type Types ¶
type Types struct { ClientForename string ClientSurname string ClientMobile string ClientEmail string SupplierForename string SupplierSurname string SupplierMobile string SupplierEmail string // contains filtered or unexported fields }
Types struct Demonstrate custom-defined types
func (*Types) RoutingID ¶
RoutingID returns the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Types) SetRoutingID ¶
SetRoutingID sets the routingID for this message, routingID should be set whenever talking to a ROUTER.
func (*Types) SetSequence ¶
SetSequence sets the sequence.