Versions in this module Expand all Collapse all v0 v0.99.0 Apr 14, 2024 Changes in this version + const CmdCancel + const CmdError + const CmdHello + const CmdInitiate + const CmdPing + const CmdPong + const CmdReady + const CmdSubscribe + const CmdUnsubscribe + const CmdWelcome + const OptionHWM + const OptionSubscribe + const OptionUnsubscribe + var ErrBadCmd = errors.New("zmq4: invalid command name") + var ErrBadFrame = errors.New("zmq4: invalid frame") + var ErrBadProperty = errors.New("zmq4: bad property") + var ErrClosedConn = errors.New("zmq4: read/write on closed connection") + func RegisterTransport(name string, trans transport.Transport) error + func Transports() []string + type Cmd struct + Body []byte + Name string + type Conn struct + Meta Metadata + Peer struct{ ... } + Server bool + func Open(rw net.Conn, sec Security, sockType SocketType, sockID SocketIdentity, ...) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) Read(p []byte) (int, error) + func (c *Conn) RecvCmd() (Cmd, error) + func (c *Conn) RecvMsg() (Msg, error) + func (c *Conn) SendCmd(name string, body []byte) error + func (c *Conn) SendMsg(msg Msg) error + func (c *Conn) Write(p []byte) (int, error) + func (conn *Conn) Closed() bool + func (conn *Conn) SetClosed() + type Metadata map[string]string + func (md *Metadata) UnmarshalZMTP(p []byte) error + func (md Metadata) MarshalZMTP() ([]byte, error) + type Msg struct + Frames [][]byte + Type MsgType + func NewMsg(frame []byte) Msg + func NewMsgFrom(frames ...[]byte) Msg + func NewMsgFromString(frames []string) Msg + func NewMsgString(frame string) Msg + func (msg Msg) Bytes() []byte + func (msg Msg) Clone() Msg + func (msg Msg) Err() error + func (msg Msg) String() string + type MsgType byte + const CmdMsg + const UsrMsg + type Option func(s *socket) + func WithAutomaticReconnect(automaticReconnect bool) Option + func WithDialerMaxRetries(maxRetries int) Option + func WithDialerRetry(retry time.Duration) Option + func WithDialerTimeout(timeout time.Duration) Option + func WithID(id SocketIdentity) Option + func WithLogger(msg *log.Logger) Option + func WithSecurity(sec Security) Option + func WithTimeout(timeout time.Duration) Option + type Property struct + K string + V string + func (prop *Property) Write(data []byte) (n int, err error) + func (prop Property) Read(data []byte) (n int, err error) + type Proxy struct + func NewProxy(ctx context.Context, front, back, capture Socket) *Proxy + func (p *Proxy) Kill() + func (p *Proxy) Pause() + func (p *Proxy) Resume() + func (p *Proxy) Run() error + func (p *Proxy) Stats() + type Queue struct + func NewQueue() *Queue + func (q *Queue) Init() + func (q *Queue) Len() int + func (q *Queue) Peek() (Msg, bool) + func (q *Queue) Pop() + func (q *Queue) Push(val Msg) + type Security interface + Decrypt func(w io.Writer, data []byte) (int, error) + Encrypt func(w io.Writer, data []byte) (int, error) + Handshake func(conn *Conn, server bool) error + Type func() SecurityType + type SecurityType string + const CurveSecurity + const NullSecurity + const PlainSecurity + type Socket interface + Addr func() net.Addr + Close func() error + Dial func(ep string) error + GetOption func(name string) (interface{}, error) + Listen func(ep string) error + Recv func() (Msg, error) + Send func(msg Msg) error + SendMulti func(msg Msg) error + SetOption func(name string, value interface{}) error + Type func() SocketType + func NewDealer(ctx context.Context, opts ...Option) Socket + func NewPair(ctx context.Context, opts ...Option) Socket + func NewPub(ctx context.Context, opts ...Option) Socket + func NewPull(ctx context.Context, opts ...Option) Socket + func NewPush(ctx context.Context, opts ...Option) Socket + func NewRep(ctx context.Context, opts ...Option) Socket + func NewReq(ctx context.Context, opts ...Option) Socket + func NewRouter(ctx context.Context, opts ...Option) Socket + func NewSub(ctx context.Context, opts ...Option) Socket + func NewXPub(ctx context.Context, opts ...Option) Socket + func NewXSub(ctx context.Context, opts ...Option) Socket + type SocketIdentity []byte + func (id SocketIdentity) String() string + type SocketType string + const Dealer + const Pair + const Pub + const Pull + const Push + const Rep + const Req + const Router + const Sub + const XPub + const XSub + func (sck SocketType) IsCompatible(peer SocketType) bool + type Topics interface + Topics func() []string + type UnknownTransportError struct + Name string + func (ute UnknownTransportError) Error() string