A Go interface to ZeroMQ version 4
Go Other
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
draft Upgrade ZeroMQ 4.2.2 -> ZerMQ 4.2.5 (non-draft only) Apr 10, 2018
examples examples/syncpub.go: using high water mark instead of time delay Aug 22, 2017
examples_security In auth examples: changed domain "global" to "domain1", because it is… Jun 27, 2014
LICENSE.txt Added license: BSD 2-Clause License Jun 12, 2014
README.md README: draft Dec 20, 2017
auth.go New function for ZeroMQ 4.2: AuthCurvePublic Nov 7, 2016
auth_test.go New function for ZeroMQ 4.2: AuthCurvePublic Nov 7, 2016
ctxoptions_unix.go Context options newly documented for ZeroMQ 4.1.3 are already availab… Sep 18, 2015
ctxoptions_windows.go Context options newly documented for ZeroMQ 4.1.3 are already availab… Sep 18, 2015
doc.go Remove message in doc.go that only belongs in branch 'draft4.2' Jun 3, 2017
dummy.c Added file dummy.c for a build time error message if cgo is disabled Oct 7, 2015
errors.go Typo in docstring of AsErrno() Sep 15, 2014
polling.go New methods: Poller.Remove and Poller.RemoveBySocket Mar 16, 2017
reactor.go typos; readme Feb 24, 2016
socketevent_test.go bugfix formatting in tests Feb 17, 2018
socketget.go New socket options for ZeroMQ version 4.2 Nov 7, 2016
socketget_unix.go Update to ZeroMQ release version 4.1.1 Jun 2, 2015
socketget_windows.go Update to ZeroMQ release version 4.1.1 Jun 2, 2015
socketset.go New socket options for ZeroMQ version 4.2 Nov 7, 2016
utils.go faster SendMessage() and SendMessageDontwait() Jan 21, 2016
zmq4.go Upgrade ZeroMQ 4.2.2 -> ZerMQ 4.2.5 (non-draft only) Apr 10, 2018
zmq4.h Upgrade ZeroMQ 4.2.2 -> ZerMQ 4.2.5 (non-draft only) Apr 10, 2018
zmq41_test.go Replaced all examples by tests Dec 22, 2015
zmq4_test.go Fix incorrect closure of test sockets Feb 17, 2016

README.md

A Go interface to ZeroMQ version 4.

Go Report Card GoDoc

This requires ZeroMQ version 4.0.1 or above. To use CURVE security in versions prior to 4.2, ZeroMQ must be installed with libsodium enabled.

Partial support for ZeroMQ 4.2 DRAFT is available in the alternate version of zmq4 draft. The API pertaining to this is subject to change. To use this:

import (
    zmq "github.com/pebbe/zmq4/draft"
)

For ZeroMQ version 3, see: http://github.com/pebbe/zmq3

For ZeroMQ version 2, see: http://github.com/pebbe/zmq2

Including all examples of ØMQ - The Guide.

Keywords: zmq, zeromq, 0mq, networks, distributed computing, message passing, fanout, pubsub, pipeline, request-reply

See also

  • Mangos — An implementation in pure Go of the SP ("Scalable Protocols") protocols
  • go-nanomsg — Language bindings for nanomsg in Go
  • goczmq — A Go interface to CZMQ

Install

go get github.com/pebbe/zmq4

Docs

API change

There has been an API change in commit 0bc5ab465849847b0556295d9a2023295c4d169e of 2014-06-27, 10:17:55 UTC in the functions AuthAllow and AuthDeny.

Old:

func AuthAllow(addresses ...string)
func AuthDeny(addresses ...string)

New:

func AuthAllow(domain string, addresses ...string)
func AuthDeny(domain string, addresses ...string)

If domain can be parsed as an IP address, it will be interpreted as such, and it and all remaining addresses are added to all domains.

So this should still work as before:

zmq.AuthAllow("127.0.0.1", "123.123.123.123")

But this won't compile:

a := []string{"127.0.0.1", "123.123.123.123"}
zmq.AuthAllow(a...)

And needs to be rewritten as:

a := []string{"127.0.0.1", "123.123.123.123"}
zmq.AuthAllow("*", a...)

Furthermore, an address can now be a single IP address, as well as an IP address and mask in CIDR notation, e.g. "123.123.123.0/24".