Hello community,
here is the log from the commit of package go-gozmq for openSUSE:Factory checked in at 2014-09-17 10:10:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/go-gozmq (Old)
and /work/SRC/openSUSE:Factory/.go-gozmq.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "go-gozmq"
Changes:
--------
--- /work/SRC/openSUSE:Factory/go-gozmq/go-gozmq.changes 2013-10-21 19:52:16.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.go-gozmq.new/go-gozmq.changes 2014-09-17 10:10:03.000000000 +0200
@@ -1,0 +2,32 @@
+Tue Sep 16 17:04:11 UTC 2014 - i@marguerite.su
+
+- add Requires: zeromq-devel
+ * gozmq needs -lzmq.
+
+-------------------------------------------------------------------
+Tue Sep 16 15:25:58 UTC 2014 - i@marguerite.su
+
+- the previous way to force building against specific zeromq
+ version is totally wrong:
+ * eg. gozmq depends zmq_2_2.go for zmq_3_x builds, and
+ zmq_2_2.go, zmq_3_x.go for zmq_4_x builds.
+ * so manually ran "go get --tags zmq_2/3/4_x \$BUILDFLAGS
+ \$IMPORTPATH" command to make sure the build is correct.
+- reenable tests. A correct build will pass tests.
+
+-------------------------------------------------------------------
+Sat Sep 6 09:02:01 UTC 2014 - i@marguerite.su
+
+- update version 0.0.0+git20140623.d1b01a2
+ * Generate SetTCPAcceptFilter(string)
+ * Generate SetROUTERMandatory(bool)
+ * Generate SetXPUBVerbose(bool)
+ * Generate MaxMsgSize()
+ * Generate DelayAttachOnConnect()
+ * Generate IPv4Only()
+ * Add SetTCPAcceptFilterNil
+ * Basic support for ZeroMQ 4.0.1
+- disable tests
+- Build against zeromq-4.x for openSUSE-13.2+
+
+-------------------------------------------------------------------
Old:
----
gozmq-0.0.0+git20130912.62f3d98.tar.bz2
New:
----
gozmq-0.0.0+git20140623.d1b01a2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ go-gozmq.spec ++++++
--- /var/tmp/diff_new_pack.E3WFaB/_old 2014-09-17 10:10:04.000000000 +0200
+++ /var/tmp/diff_new_pack.E3WFaB/_new 2014-09-17 10:10:04.000000000 +0200
@@ -1,8 +1,8 @@
#
# spec file for package go-gozmq
#
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011 Sascha Peilicke
-# Copyright (c) 2013 SUSE Linux Products GmbH
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,51 +18,57 @@
Name: go-gozmq
-Version: 0.0.0+git20130912.62f3d98
+Version: 0.0.0+git20140623.d1b01a2
Release: 0
Summary: Go bindings for ZeroMQ
-Group: Development/Languages/Other
License: Apache-2.0
-URL: http://github.com/alecthomas/gozmq
-Source0: gozmq-%{version}.tar.bz2
+Group: Development/Languages/Other
+Url: http://github.com/alecthomas/gozmq
+Source: gozmq-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: go-devel
BuildRequires: pkg-config
BuildRequires: zeromq-devel
-%if 0%{?suse_version} >= 1100
-Recommends: go-gozmq-doc
-Recommends: zeromq
-%endif
+Requires: zeromq-devel
%{go_provides}
%{go_requires}
+%{go_recommends}
%description
Go bindings for the ZeroMQ library.
-%package doc
-Summary: API documenation
-Group: Documentation/Other
-Requires: %{name} = %{version}
-
-%description doc
-API, examples and documentation.
+%godoc_package
%prep
%setup -q -n gozmq-%{version}
+
+# 12.3+ has zeromq 3.x and 12.2- has zeromq 2.1.
+# zmq_3_x_test.go used zeromq 3.x specific functions;
+# zmq_test.go used zeromq 2.x (but not 2.1 only)
+# specific functions.
%if 0%{?suse_version} >= 1230
-rm *2_*.go zmq.go zmq_test.go
+rm zmq_test.go
%else
-rm *3_*.go zmq.go zmq_test.go
+rm zmq_3_x_test.go zmq_test.go
%endif
# The following tests need access to a running zeromq:
rm gozmqgen/main_test.go
%build
%goprep github.com/alecthomas/gozmq
-#gofix github.com/alecthomas/gozmq
-#gobuild gozmqfix
-#_builddir/go/bin/gozmqfix .
-%gobuild .
+# manual build
+export IMPORTPATH="github.com/alecthomas/gozmq"
+export BUILDFLAGS="-s -v -p 4 -x"
+export GOPATH=%{_builddir}/go:%{_libdir}/go/contrib
+%if 0%{?suse_version} >= 1230
+%if 0%{?suse_version} > 1315
+go get --tags zmq_4_x $BUILDFLAGS $IMPORTPATH
+%else
+go get --tags zmq_3_x $BUILDFLAGS $IMPORTPATH
+%endif
+%else
+go get --tags zmq_2_1 $BUILDFLAGS $IMPORTPATH
+%endif
%install
%goinstall
@@ -73,7 +79,7 @@
%files
%defattr(-,root,root,-)
-%doc AUTHORS README.md examples
+%doc AUTHORS README.md
%{go_contribdir}/*
%files doc
++++++ gozmq-0.0.0+git20130912.62f3d98.tar.bz2 -> gozmq-0.0.0+git20140623.d1b01a2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/README.md new/gozmq-0.0.0+git20140623.d1b01a2/README.md
--- old/gozmq-0.0.0+git20130912.62f3d98/README.md 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/README.md 2014-09-06 10:59:35.000000000 +0200
@@ -1,4 +1,6 @@
-# Go (golang) Bindings for 0mq (zmq, zeromq)
+# _NOTE:_ These gozmq bindings are in maintenance mode. Only critical bugs will be fixed. Henceforth I would suggest using [@pebbe's](https://github.com/pebbe) actively maintained bindings for [zmq2](https://github.com/pebbe/zmq2), [zmq3](https://github.com/pebbe/zmq3) and [zmq4](https://github.com/pebbe/zmq4).
+
+## Go (golang) Bindings for 0mq (zmq, zeromq)
[![Build Status](https://travis-ci.org/alecthomas/gozmq.png)](https://travis-ci.org/alecthomas/gozmq)
@@ -23,25 +25,23 @@
## Installing
-GoZMQ currently supports ZMQ 2.1.x, 2.2.x and *basic* support for 3.x. Following are instructions on how to compile against these versions.
+GoZMQ currently supports ZMQ 2.1.x, 2.2.x, 3.x and 4.x. Following are instructions on how to compile against these versions.
-Install gozmq with:
+For ZeroMQ 2.2.x install with:
go get github.com/alecthomas/gozmq
-This implementation works currently against:: ZeroMQ 2.2.x
-
-### ZeroMQ 2.1.x
-
-If you're using ZeroMQ 2.1.x, install with:
+For 2.1.x install with:
go get -tags zmq_2_1 github.com/alecthomas/gozmq
-### ZeroMQ 3.x
-
-There is *basic* support for ZeroMQ 3.x. Install with:
+For 3.x install with:
go get -tags zmq_3_x github.com/alecthomas/gozmq
+
+For 4.x install with:
+
+ go get -tags zmq_4_x github.com/alecthomas/gozmq
### Troubleshooting
@@ -51,15 +51,15 @@
eg. If you installed zmq into `/opt/zmq` you might try:
- CGO_CFLAGS=-I/opt/zmq/include CGO_LDFLAGS=-L/opt/zmq/lib \
- go get github.com/alecthomas/gozmq
+ CGO_CFLAGS=-I/opt/zmq/include CGO_LDFLAGS=-L/opt/zmq/lib \
+ go get github.com/alecthomas/gozmq
#### Mismatch in version of ZMQ
If you get errors like this with 'go get' or 'go build':
1: error: 'ZMQ_FOO' undeclared (first use in this function)
-
+
There are two possibilities:
1. Your version of zmq is *very* old. In this case you will need to download and build zmq yourself.
@@ -155,119 +155,119 @@
```go
const (
- // NewSocket types
- PAIR = SocketType(C.ZMQ_PAIR)
- PUB = SocketType(C.ZMQ_PUB)
- SUB = SocketType(C.ZMQ_SUB)
- REQ = SocketType(C.ZMQ_REQ)
- REP = SocketType(C.ZMQ_REP)
- DEALER = SocketType(C.ZMQ_DEALER)
- ROUTER = SocketType(C.ZMQ_ROUTER)
- PULL = SocketType(C.ZMQ_PULL)
- PUSH = SocketType(C.ZMQ_PUSH)
- XPUB = SocketType(C.ZMQ_XPUB)
- XSUB = SocketType(C.ZMQ_XSUB)
-
- // Deprecated aliases
- XREQ = DEALER
- XREP = ROUTER
- UPSTREAM = PULL
- DOWNSTREAM = PUSH
-
- // NewSocket options
- AFFINITY = UInt64SocketOption(C.ZMQ_AFFINITY)
- IDENTITY = StringSocketOption(C.ZMQ_IDENTITY)
- SUBSCRIBE = StringSocketOption(C.ZMQ_SUBSCRIBE)
- UNSUBSCRIBE = StringSocketOption(C.ZMQ_UNSUBSCRIBE)
- RATE = Int64SocketOption(C.ZMQ_RATE)
- RECOVERY_IVL = Int64SocketOption(C.ZMQ_RECOVERY_IVL)
- SNDBUF = UInt64SocketOption(C.ZMQ_SNDBUF)
- RCVBUF = UInt64SocketOption(C.ZMQ_RCVBUF)
- FD = Int64SocketOption(C.ZMQ_FD)
- EVENTS = UInt64SocketOption(C.ZMQ_EVENTS)
- TYPE = UInt64SocketOption(C.ZMQ_TYPE)
- LINGER = IntSocketOption(C.ZMQ_LINGER)
- RECONNECT_IVL = IntSocketOption(C.ZMQ_RECONNECT_IVL)
- RECONNECT_IVL_MAX = IntSocketOption(C.ZMQ_RECONNECT_IVL_MAX)
- BACKLOG = IntSocketOption(C.ZMQ_BACKLOG)
+ // NewSocket types
+ PAIR = SocketType(C.ZMQ_PAIR)
+ PUB = SocketType(C.ZMQ_PUB)
+ SUB = SocketType(C.ZMQ_SUB)
+ REQ = SocketType(C.ZMQ_REQ)
+ REP = SocketType(C.ZMQ_REP)
+ DEALER = SocketType(C.ZMQ_DEALER)
+ ROUTER = SocketType(C.ZMQ_ROUTER)
+ PULL = SocketType(C.ZMQ_PULL)
+ PUSH = SocketType(C.ZMQ_PUSH)
+ XPUB = SocketType(C.ZMQ_XPUB)
+ XSUB = SocketType(C.ZMQ_XSUB)
+
+ // Deprecated aliases
+ XREQ = DEALER
+ XREP = ROUTER
+ UPSTREAM = PULL
+ DOWNSTREAM = PUSH
+
+ // NewSocket options
+ AFFINITY = UInt64SocketOption(C.ZMQ_AFFINITY)
+ IDENTITY = StringSocketOption(C.ZMQ_IDENTITY)
+ SUBSCRIBE = StringSocketOption(C.ZMQ_SUBSCRIBE)
+ UNSUBSCRIBE = StringSocketOption(C.ZMQ_UNSUBSCRIBE)
+ RATE = Int64SocketOption(C.ZMQ_RATE)
+ RECOVERY_IVL = Int64SocketOption(C.ZMQ_RECOVERY_IVL)
+ SNDBUF = UInt64SocketOption(C.ZMQ_SNDBUF)
+ RCVBUF = UInt64SocketOption(C.ZMQ_RCVBUF)
+ FD = Int64SocketOption(C.ZMQ_FD)
+ EVENTS = UInt64SocketOption(C.ZMQ_EVENTS)
+ TYPE = UInt64SocketOption(C.ZMQ_TYPE)
+ LINGER = IntSocketOption(C.ZMQ_LINGER)
+ RECONNECT_IVL = IntSocketOption(C.ZMQ_RECONNECT_IVL)
+ RECONNECT_IVL_MAX = IntSocketOption(C.ZMQ_RECONNECT_IVL_MAX)
+ BACKLOG = IntSocketOption(C.ZMQ_BACKLOG)
- // Send/recv options
- SNDMORE = SendRecvOption(C.ZMQ_SNDMORE)
+ // Send/recv options
+ SNDMORE = SendRecvOption(C.ZMQ_SNDMORE)
)
```
```go
const (
- POLLIN = PollEvents(C.ZMQ_POLLIN)
- POLLOUT = PollEvents(C.ZMQ_POLLOUT)
- POLLERR = PollEvents(C.ZMQ_POLLERR)
+ POLLIN = PollEvents(C.ZMQ_POLLIN)
+ POLLOUT = PollEvents(C.ZMQ_POLLOUT)
+ POLLERR = PollEvents(C.ZMQ_POLLERR)
)
```
```go
const (
- STREAMER = DeviceType(C.ZMQ_STREAMER)
- FORWARDER = DeviceType(C.ZMQ_FORWARDER)
- QUEUE = DeviceType(C.ZMQ_QUEUE)
+ STREAMER = DeviceType(C.ZMQ_STREAMER)
+ FORWARDER = DeviceType(C.ZMQ_FORWARDER)
+ QUEUE = DeviceType(C.ZMQ_QUEUE)
)
```
```go
const (
- RCVTIMEO = IntSocketOption(C.ZMQ_RCVTIMEO)
- SNDTIMEO = IntSocketOption(C.ZMQ_SNDTIMEO)
+ RCVTIMEO = IntSocketOption(C.ZMQ_RCVTIMEO)
+ SNDTIMEO = IntSocketOption(C.ZMQ_SNDTIMEO)
)
```
```go
const (
- RCVMORE = UInt64SocketOption(C.ZMQ_RCVMORE)
- RECOVERY_IVL_MSEC = Int64SocketOption(C.ZMQ_RECOVERY_IVL_MSEC)
- SWAP = Int64SocketOption(C.ZMQ_SWAP)
- MCAST_LOOP = Int64SocketOption(C.ZMQ_MCAST_LOOP)
- HWM = UInt64SocketOption(C.ZMQ_HWM)
- NOBLOCK = SendRecvOption(C.ZMQ_NOBLOCK)
+ RCVMORE = UInt64SocketOption(C.ZMQ_RCVMORE)
+ RECOVERY_IVL_MSEC = Int64SocketOption(C.ZMQ_RECOVERY_IVL_MSEC)
+ SWAP = Int64SocketOption(C.ZMQ_SWAP)
+ MCAST_LOOP = Int64SocketOption(C.ZMQ_MCAST_LOOP)
+ HWM = UInt64SocketOption(C.ZMQ_HWM)
+ NOBLOCK = SendRecvOption(C.ZMQ_NOBLOCK)
- // Forwards-compatible aliases:
- DONTWAIT = NOBLOCK
+ // Forwards-compatible aliases:
+ DONTWAIT = NOBLOCK
)
```
```go
const (
- RCVMORE = IntSocketOption(C.ZMQ_RCVMORE)
- SNDHWM = IntSocketOption(C.ZMQ_SNDHWM)
- RCVHWM = IntSocketOption(C.ZMQ_RCVHWM)
-
- // TODO Not documented in the man page...
- //LAST_ENDPOINT = UInt64SocketOption(C.ZMQ_LAST_ENDPOINT)
- FAIL_UNROUTABLE = BoolSocketOption(C.ZMQ_FAIL_UNROUTABLE)
- TCP_KEEPALIVE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE)
- TCP_KEEPALIVE_CNT = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_CNT)
- TCP_KEEPALIVE_IDLE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_IDLE)
- TCP_KEEPALIVE_INTVL = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_INTVL)
- TCP_ACCEPT_FILTER = StringSocketOption(C.ZMQ_TCP_ACCEPT_FILTER)
+ RCVMORE = IntSocketOption(C.ZMQ_RCVMORE)
+ SNDHWM = IntSocketOption(C.ZMQ_SNDHWM)
+ RCVHWM = IntSocketOption(C.ZMQ_RCVHWM)
+
+ // TODO Not documented in the man page...
+ //LAST_ENDPOINT = UInt64SocketOption(C.ZMQ_LAST_ENDPOINT)
+ FAIL_UNROUTABLE = BoolSocketOption(C.ZMQ_FAIL_UNROUTABLE)
+ TCP_KEEPALIVE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE)
+ TCP_KEEPALIVE_CNT = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_CNT)
+ TCP_KEEPALIVE_IDLE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_IDLE)
+ TCP_KEEPALIVE_INTVL = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_INTVL)
+ TCP_ACCEPT_FILTER = StringSocketOption(C.ZMQ_TCP_ACCEPT_FILTER)
- // Message options
- MORE = MessageOption(C.ZMQ_MORE)
+ // Message options
+ MORE = MessageOption(C.ZMQ_MORE)
- // Send/recv options
- DONTWAIT = SendRecvOption(C.ZMQ_DONTWAIT)
+ // Send/recv options
+ DONTWAIT = SendRecvOption(C.ZMQ_DONTWAIT)
- // Deprecated aliases
- NOBLOCK = DONTWAIT
+ // Deprecated aliases
+ NOBLOCK = DONTWAIT
)
```
```go
var (
- // Additional ZMQ errors
- ENOTSOCK error = zmqErrno(C.ENOTSOCK)
- EFSM error = zmqErrno(C.EFSM)
- EINVAL error = zmqErrno(C.EINVAL)
- ENOCOMPATPROTO error = zmqErrno(C.ENOCOMPATPROTO)
- ETERM error = zmqErrno(C.ETERM)
- EMTHREAD error = zmqErrno(C.EMTHREAD)
+ // Additional ZMQ errors
+ ENOTSOCK error = zmqErrno(C.ENOTSOCK)
+ EFSM error = zmqErrno(C.EFSM)
+ EINVAL error = zmqErrno(C.EINVAL)
+ ENOCOMPATPROTO error = zmqErrno(C.ENOCOMPATPROTO)
+ ETERM error = zmqErrno(C.ETERM)
+ EMTHREAD error = zmqErrno(C.EMTHREAD)
)
```
@@ -403,10 +403,10 @@
```go
type PollItem struct {
- Socket *Socket // socket to poll for events on
- Fd ZmqOsSocketType // fd to poll for events on as returned from os.File.Fd()
- Events PollEvents // event set to poll for
- REvents PollEvents // events that were present
+ Socket *Socket // socket to poll for events on
+ Fd ZmqOsSocketType // fd to poll for events on as returned from os.File.Fd()
+ Events PollEvents // event set to poll for
+ REvents PollEvents // events that were present
}
```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/gozmqgen/main.go new/gozmq-0.0.0+git20140623.d1b01a2/gozmqgen/main.go
--- old/gozmq-0.0.0+git20130912.62f3d98/gozmqgen/main.go 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/gozmqgen/main.go 2014-09-06 10:59:35.000000000 +0200
@@ -22,7 +22,7 @@
}
var args = Args{
- zversion: "2.1,2.2,3.2",
+ zversion: "2.1,2.2,3.2,4.0",
pages: "getsockopt,setsockopt",
comment_width: 72,
templsource: "./gozmqgen/template.txt",
@@ -86,20 +86,34 @@
var (
gotypes = map[string]map[string]string{
- "binary data": map[string]string{"": "string"},
- "character string": map[string]string{"": "string"},
+ "binary data": map[string]string{
+ "": "string",
+ },
+ "binary data or Z85 text string": map[string]string{
+ "": "string",
+ },
+ "character string": map[string]string{
+ "": "string",
+ },
"int": map[string]string{
"": "int",
"boolean": "bool",
"milliseconds": "time.Duration",
},
- "int on POSIX systems, SOCKET on Windows": map[string]string{"": "int"},
+ "int on POSIX systems, SOCKET on Windows": map[string]string{
+ "": "int",
+ },
"int64_t": map[string]string{
"": "int64",
"boolean": "bool",
"milliseconds": "time.Duration",
},
- "uint32_t": map[string]string{"": "uint32"},
+ "NULL-terminated character string": map[string]string{
+ "": "string",
+ },
+ "uint32_t": map[string]string{
+ "": "uint32",
+ },
"uint64_t": map[string]string{
"": "uint64",
"boolean": "bool",
@@ -107,13 +121,15 @@
}
ztypes = map[string]map[string]string{
- "binary data": map[string]string{"": "String"},
- "character string": map[string]string{"": "String"},
- "int": map[string]string{"": "Int"},
+ "binary data": map[string]string{"": "String"},
+ "binary data or Z85 text string": map[string]string{"": "String"},
+ "character string": map[string]string{"": "String"},
+ "int": map[string]string{"": "Int"},
"int on POSIX systems, SOCKET on Windows": map[string]string{"": "Int"},
- "int64_t": map[string]string{"": "Int64"},
- "uint32_t": map[string]string{"": "UInt32"},
- "uint64_t": map[string]string{"": "UInt64"},
+ "int64_t": map[string]string{"": "Int64"},
+ "NULL-terminated character string": map[string]string{"": "String"},
+ "uint32_t": map[string]string{"": "UInt32"},
+ "uint64_t": map[string]string{"": "UInt64"},
}
lowtypes = map[string]string{
@@ -127,10 +143,11 @@
"buf": "Buf",
"Hwm": "HWM",
"hwm": "HWM",
- "Ipv4only": "IPV4Only",
+ "Ipv4only": "IPv4Only",
"more": "More",
"msg": "Msg",
"pub": "PUB",
+ "Router": "ROUTER",
"size": "Size",
"Tcp": "TCP",
"timeo": "Timeout",
@@ -163,21 +180,17 @@
// shortname : unit
fixedunits = map[string]string{
- "XPUB_VERBOSE": "boolean",
+ "DELAY_ATTACH_ON_CONNECT": "boolean",
+ "ROUTER_MANDATORY": "boolean",
+ "XPUB_VERBOSE": "boolean",
}
// version : shortname
ignore = map[string]map[string]bool{
"": map[string]bool{
- "DELAY_ATTACH_ON_CONNECT": true,
- "FD": true,
- "IPV4ONLY": true,
- "LAST_ENDPOINT": true,
- "MAXMSGSIZE": true,
- "MULTICAST_HOPS": true,
- "ROUTER_MANDATORY": true,
- "TCP_ACCEPT_FILTER": true,
- "XPUB_VERBOSE": true,
+ "FD": true,
+ "LAST_ENDPOINT": true,
+ "MULTICAST_HOPS": true,
},
"2.1": map[string]bool{
"RECOVERY_IVL": true,
@@ -195,8 +208,9 @@
buildtags = map[string]string{
"2.1": "zmq_2_1",
- "2.2": "!zmq_2_1,!zmq_3_x",
+ "2.2": "!zmq_2_1,!zmq_3_x,!zmq_4_x",
"3.2": "zmq_3_x",
+ "4.0": "zmq_4_x",
}
)
@@ -363,6 +377,9 @@
case "Option value unit":
option.unit = value
break
+ case "Option value size":
+ option.unit = "Z85"
+ break
}
if len(option.typ) > 0 && len(option.unit) > 0 {
if val, ok := fixedtypes[""][option.shortname]; ok {
@@ -375,6 +392,9 @@
} else {
option.lowtype = option.typ
}
+ if val, ok := fixedunits[option.shortname]; ok {
+ option.unit = val
+ }
gomap := gotypes[option.typ]
if val, ok := gomap[option.unit]; ok {
option.gotype = val
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmq_2_x.go new/gozmq-0.0.0+git20140623.d1b01a2/zmq_2_x.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmq_2_x.go 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmq_2_x.go 2014-09-06 10:59:35.000000000 +0200
@@ -1,4 +1,4 @@
-// +build !zmq_3_x
+// +build !zmq_3_x,!zmq_4_x
/*
Copyright 2010-2012 Alec Thomas
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmq_3_x.go new/gozmq-0.0.0+git20140623.d1b01a2/zmq_3_x.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmq_3_x.go 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmq_3_x.go 2014-09-06 10:59:35.000000000 +0200
@@ -1,4 +1,4 @@
-// +build zmq_3_x
+// +build zmq_3_x zmq_4_x
/*
Copyright 2010-2012 Alec Thomas
@@ -37,12 +37,17 @@
// TODO Not documented in the man page...
//LAST_ENDPOINT = UInt64SocketOption(C.ZMQ_LAST_ENDPOINT)
- FAIL_UNROUTABLE = BoolSocketOption(C.ZMQ_FAIL_UNROUTABLE)
- TCP_KEEPALIVE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE)
- TCP_KEEPALIVE_CNT = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_CNT)
- TCP_KEEPALIVE_IDLE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_IDLE)
- TCP_KEEPALIVE_INTVL = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_INTVL)
- TCP_ACCEPT_FILTER = StringSocketOption(C.ZMQ_TCP_ACCEPT_FILTER)
+ DELAY_ATTACH_ON_CONNECT = IntSocketOption(C.ZMQ_DELAY_ATTACH_ON_CONNECT)
+ FAIL_UNROUTABLE = BoolSocketOption(C.ZMQ_FAIL_UNROUTABLE)
+ IPV4ONLY = IntSocketOption(C.ZMQ_IPV4ONLY)
+ MAXMSGSIZE = Int64SocketOption(C.ZMQ_MAXMSGSIZE)
+ ROUTER_MANDATORY = IntSocketOption(C.ZMQ_ROUTER_MANDATORY)
+ TCP_KEEPALIVE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE)
+ TCP_KEEPALIVE_CNT = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_CNT)
+ TCP_KEEPALIVE_IDLE = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_IDLE)
+ TCP_KEEPALIVE_INTVL = IntSocketOption(C.ZMQ_TCP_KEEPALIVE_INTVL)
+ TCP_ACCEPT_FILTER = StringSocketOption(C.ZMQ_TCP_ACCEPT_FILTER)
+ XPUB_VERBOSE = IntSocketOption(C.ZMQ_XPUB_VERBOSE)
// Message options
MORE = MessageOption(C.ZMQ_MORE)
@@ -129,6 +134,10 @@
return rcv
}
+func (s *Socket) SetTCPAcceptFilterNil() error {
+ return s.SetSockOptStringNil(TCP_ACCEPT_FILTER)
+}
+
// Disconnect the socket from the address.
// int zmq_disconnect (void *s, const char *addr);
func (s *Socket) Disconnect(address string) error {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmq_3_x_test.go new/gozmq-0.0.0+git20140623.d1b01a2/zmq_3_x_test.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmq_3_x_test.go 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmq_3_x_test.go 2014-09-06 10:59:35.000000000 +0200
@@ -1,4 +1,4 @@
-// +build zmq_3_x
+// +build zmq_3_x zmq_4_x
/*
Copyright 2010 Alec Thomas
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmq_4_x.go new/gozmq-0.0.0+git20140623.d1b01a2/zmq_4_x.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmq_4_x.go 1970-01-01 01:00:00.000000000 +0100
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmq_4_x.go 2014-09-06 10:59:35.000000000 +0200
@@ -0,0 +1,46 @@
+// +build zmq_4_x
+
+/*
+ Copyright 2010-2012 Alec Thomas
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package gozmq
+
+/*
+#cgo pkg-config: libzmq
+#include
+#include
+#include
+*/
+import "C"
+
+const (
+ IPV6 = IntSocketOption(C.ZMQ_IPV6)
+ IMMEDIATE = IntSocketOption(C.ZMQ_IMMEDIATE)
+ MECHANISM = IntSocketOption(C.ZMQ_MECHANISM)
+ PLAIN_SERVER = IntSocketOption(C.ZMQ_PLAIN_SERVER)
+ PLAIN_USERNAME = StringSocketOption(C.ZMQ_PLAIN_USERNAME)
+ PLAIN_PASSWORD = StringSocketOption(C.ZMQ_PLAIN_PASSWORD)
+ CURVE_PUBLICKEY = StringSocketOption(C.ZMQ_CURVE_PUBLICKEY)
+ CURVE_SECRETKEY = StringSocketOption(C.ZMQ_CURVE_SECRETKEY)
+ CURVE_SERVERKEY = StringSocketOption(C.ZMQ_CURVE_SERVERKEY)
+ ZAP_DOMAIN = StringSocketOption(C.ZMQ_ZAP_DOMAIN)
+ ROUTER_RAW = IntSocketOption(C.ZMQ_ROUTER_RAW)
+ PROBE_ROUTER = IntSocketOption(C.ZMQ_PROBE_ROUTER)
+ REQ_CORRELATE = IntSocketOption(C.ZMQ_REQ_CORRELATE)
+ REQ_RELAXED = IntSocketOption(C.ZMQ_REQ_RELAXED)
+ CURVE_SERVER = IntSocketOption(C.ZMQ_CURVE_SERVER)
+ CONFLATE = IntSocketOption(C.ZMQ_CONFLATE)
+)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmqgen_2_2.go new/gozmq-0.0.0+git20140623.d1b01a2/zmqgen_2_2.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmqgen_2_2.go 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmqgen_2_2.go 2014-09-06 10:59:35.000000000 +0200
@@ -1,4 +1,4 @@
-// +build !zmq_2_1,!zmq_3_x
+// +build !zmq_2_1,!zmq_3_x,!zmq_4_x
//
package gozmq
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmqgen_3_2.go new/gozmq-0.0.0+git20140623.d1b01a2/zmqgen_3_2.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmqgen_3_2.go 2013-10-18 15:11:48.000000000 +0200
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmqgen_3_2.go 2014-09-06 10:59:35.000000000 +0200
@@ -129,6 +129,14 @@
return s.GetSockOptInt(BACKLOG)
}
+// ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size.
+//
+// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc17
+//
+func (s *Socket) MaxMsgSize() (int64, error) {
+ return s.GetSockOptInt64(MAXMSGSIZE)
+}
+
// ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc19
@@ -147,6 +155,24 @@
return time.Duration(ms) * time.Millisecond, err
}
+// ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status.
+//
+// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc21
+//
+func (s *Socket) IPv4Only() (bool, error) {
+ value, err := s.GetSockOptInt(IPV4ONLY)
+ return value != 0, err
+}
+
+// ZMQ_DELAY_ATTACH_ON_CONNECT: Retrieve attach-on-connect value.
+//
+// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc22
+//
+func (s *Socket) DelayAttachOnConnect() (bool, error) {
+ value, err := s.GetSockOptInt(DELAY_ATTACH_ON_CONNECT)
+ return value != 0, err
+}
+
// ZMQ_EVENTS: Retrieve socket event state.
//
// See: http://api.zeromq.org/3.2:zmq-getsockopt#toc24
@@ -301,6 +327,14 @@
return s.SetSockOptInt(BACKLOG, value)
}
+// ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size.
+//
+// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc17
+//
+func (s *Socket) SetMaxMsgSize(value int64) error {
+ return s.SetSockOptInt64(MAXMSGSIZE, value)
+}
+
// ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc19
@@ -317,6 +351,50 @@
return s.SetSockOptInt(SNDTIMEO, int(value/time.Millisecond))
}
+// ZMQ_IPV4ONLY: Use IPv4-only sockets.
+//
+// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc21
+//
+func (s *Socket) SetIPv4Only(value bool) error {
+ if value {
+ return s.SetSockOptInt(IPV4ONLY, 1)
+ }
+ return s.SetSockOptInt(IPV4ONLY, 0)
+}
+
+// ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made.
+//
+// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc22
+//
+func (s *Socket) SetDelayAttachOnConnect(value bool) error {
+ if value {
+ return s.SetSockOptInt(DELAY_ATTACH_ON_CONNECT, 1)
+ }
+ return s.SetSockOptInt(DELAY_ATTACH_ON_CONNECT, 0)
+}
+
+// ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets.
+//
+// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc23
+//
+func (s *Socket) SetROUTERMandatory(value bool) error {
+ if value {
+ return s.SetSockOptInt(ROUTER_MANDATORY, 1)
+ }
+ return s.SetSockOptInt(ROUTER_MANDATORY, 0)
+}
+
+// ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets.
+//
+// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc24
+//
+func (s *Socket) SetXPUBVerbose(value bool) error {
+ if value {
+ return s.SetSockOptInt(XPUB_VERBOSE, 1)
+ }
+ return s.SetSockOptInt(XPUB_VERBOSE, 0)
+}
+
// ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option.
//
// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc25
@@ -348,3 +426,11 @@
func (s *Socket) SetTCPKeepaliveIntvl(value int) error {
return s.SetSockOptInt(TCP_KEEPALIVE_INTVL, value)
}
+
+// ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections.
+//
+// See: http://api.zeromq.org/3.2:zmq-setsockopt#toc29
+//
+func (s *Socket) SetTCPAcceptFilter(value string) error {
+ return s.SetSockOptString(TCP_ACCEPT_FILTER, value)
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gozmq-0.0.0+git20130912.62f3d98/zmqgen_4_0.go new/gozmq-0.0.0+git20140623.d1b01a2/zmqgen_4_0.go
--- old/gozmq-0.0.0+git20130912.62f3d98/zmqgen_4_0.go 1970-01-01 01:00:00.000000000 +0100
+++ new/gozmq-0.0.0+git20140623.d1b01a2/zmqgen_4_0.go 2014-09-06 10:59:35.000000000 +0200
@@ -0,0 +1,627 @@
+// +build zmq_4_x
+//
+
+package gozmq
+
+import (
+ "time"
+)
+
+// This file was generated automatically. Changes made here will be lost.
+
+// Socket Option Getters
+
+// ZMQ_TYPE: Retrieve socket type.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc3
+//
+func (s *Socket) Type() (SocketType, error) {
+ value, err := s.GetSockOptUInt64(TYPE)
+ return SocketType(value), err
+}
+
+// ZMQ_RCVMORE: More message data parts to follow.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc4
+//
+func (s *Socket) RcvMore() (bool, error) {
+ value, err := s.GetSockOptInt(RCVMORE)
+ return value != 0, err
+}
+
+// ZMQ_SNDHWM: Retrieves high water mark for outbound messages.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc5
+//
+func (s *Socket) SndHWM() (int, error) {
+ return s.GetSockOptInt(SNDHWM)
+}
+
+// ZMQ_RCVHWM: Retrieve high water mark for inbound messages.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc6
+//
+func (s *Socket) RcvHWM() (int, error) {
+ return s.GetSockOptInt(RCVHWM)
+}
+
+// ZMQ_AFFINITY: Retrieve I/O thread affinity.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc7
+//
+func (s *Socket) Affinity() (uint64, error) {
+ return s.GetSockOptUInt64(AFFINITY)
+}
+
+// ZMQ_IDENTITY: Retrieve socket identity.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc8
+//
+func (s *Socket) Identity() (string, error) {
+ return s.GetSockOptString(IDENTITY)
+}
+
+// ZMQ_RATE: Retrieve multicast data rate.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc9
+//
+func (s *Socket) Rate() (int64, error) {
+ return s.GetSockOptInt64(RATE)
+}
+
+// ZMQ_RECOVERY_IVL: Get multicast recovery interval.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc10
+//
+func (s *Socket) RecoveryIvl() (time.Duration, error) {
+ ms, err := s.GetSockOptInt64(RECOVERY_IVL)
+ return time.Duration(ms) * time.Millisecond, err
+}
+
+// ZMQ_SNDBUF: Retrieve kernel transmit buffer size.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc11
+//
+func (s *Socket) SndBuf() (uint64, error) {
+ return s.GetSockOptUInt64(SNDBUF)
+}
+
+// ZMQ_RCVBUF: Retrieve kernel receive buffer size.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc12
+//
+func (s *Socket) RcvBuf() (uint64, error) {
+ return s.GetSockOptUInt64(RCVBUF)
+}
+
+// ZMQ_LINGER: Retrieve linger period for socket shutdown.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc13
+//
+func (s *Socket) Linger() (time.Duration, error) {
+ ms, err := s.GetSockOptInt(LINGER)
+ return time.Duration(ms) * time.Millisecond, err
+}
+
+// ZMQ_RECONNECT_IVL: Retrieve reconnection interval.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc14
+//
+func (s *Socket) ReconnectIvl() (time.Duration, error) {
+ ms, err := s.GetSockOptInt(RECONNECT_IVL)
+ return time.Duration(ms) * time.Millisecond, err
+}
+
+// ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc15
+//
+func (s *Socket) ReconnectIvlMax() (time.Duration, error) {
+ ms, err := s.GetSockOptInt(RECONNECT_IVL_MAX)
+ return time.Duration(ms) * time.Millisecond, err
+}
+
+// ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc16
+//
+func (s *Socket) Backlog() (int, error) {
+ return s.GetSockOptInt(BACKLOG)
+}
+
+// ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc17
+//
+func (s *Socket) MaxMsgSize() (int64, error) {
+ return s.GetSockOptInt64(MAXMSGSIZE)
+}
+
+// ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc19
+//
+func (s *Socket) RcvTimeout() (time.Duration, error) {
+ ms, err := s.GetSockOptInt(RCVTIMEO)
+ return time.Duration(ms) * time.Millisecond, err
+}
+
+// ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc20
+//
+func (s *Socket) SndTimeout() (time.Duration, error) {
+ ms, err := s.GetSockOptInt(SNDTIMEO)
+ return time.Duration(ms) * time.Millisecond, err
+}
+
+// ZMQ_IPV6: Retrieve IPv6 socket status.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc21
+//
+func (s *Socket) Ipv6() (bool, error) {
+ value, err := s.GetSockOptInt(IPV6)
+ return value != 0, err
+}
+
+// ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc22
+//
+func (s *Socket) IPv4Only() (bool, error) {
+ value, err := s.GetSockOptInt(IPV4ONLY)
+ return value != 0, err
+}
+
+// ZMQ_IMMEDIATE: Retrieve attach-on-connect value.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc23
+//
+func (s *Socket) Immediate() (bool, error) {
+ value, err := s.GetSockOptInt(IMMEDIATE)
+ return value != 0, err
+}
+
+// ZMQ_EVENTS: Retrieve socket event state.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc25
+//
+func (s *Socket) Events() (uint64, error) {
+ return s.GetSockOptUInt64(EVENTS)
+}
+
+// ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc27
+//
+func (s *Socket) TCPKeepalive() (int, error) {
+ return s.GetSockOptInt(TCP_KEEPALIVE)
+}
+
+// ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS).
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc28
+//
+func (s *Socket) TCPKeepaliveIdle() (int, error) {
+ return s.GetSockOptInt(TCP_KEEPALIVE_IDLE)
+}
+
+// ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc29
+//
+func (s *Socket) TCPKeepaliveCnt() (int, error) {
+ return s.GetSockOptInt(TCP_KEEPALIVE_CNT)
+}
+
+// ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc30
+//
+func (s *Socket) TCPKeepaliveIntvl() (int, error) {
+ return s.GetSockOptInt(TCP_KEEPALIVE_INTVL)
+}
+
+// ZMQ_MECHANISM: Retrieve current security mechanism.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc31
+//
+func (s *Socket) Mechanism() (int, error) {
+ return s.GetSockOptInt(MECHANISM)
+}
+
+// ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc32
+//
+func (s *Socket) PlainServer() (int, error) {
+ return s.GetSockOptInt(PLAIN_SERVER)
+}
+
+// ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc33
+//
+func (s *Socket) PlainUsername() (string, error) {
+ return s.GetSockOptString(PLAIN_USERNAME)
+}
+
+// ZMQ_PLAIN_PASSWORD: Retrieve current password.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc34
+//
+func (s *Socket) PlainPassword() (string, error) {
+ return s.GetSockOptString(PLAIN_PASSWORD)
+}
+
+// ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc35
+//
+func (s *Socket) CurvePublickey() (string, error) {
+ return s.GetSockOptString(CURVE_PUBLICKEY)
+}
+
+// ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc36
+//
+func (s *Socket) CurveSecretkey() (string, error) {
+ return s.GetSockOptString(CURVE_SECRETKEY)
+}
+
+// ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc37
+//
+func (s *Socket) CurveServerkey() (string, error) {
+ return s.GetSockOptString(CURVE_SERVERKEY)
+}
+
+// ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain.
+//
+// See: http://api.zeromq.org/4.0:zmq-getsockopt#toc38
+//
+func (s *Socket) ZapDomain() (string, error) {
+ return s.GetSockOptString(ZAP_DOMAIN)
+}
+
+// Socket Option Setters
+
+// ZMQ_SNDHWM: Set high water mark for outbound messages.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc3
+//
+func (s *Socket) SetSndHWM(value int) error {
+ return s.SetSockOptInt(SNDHWM, value)
+}
+
+// ZMQ_RCVHWM: Set high water mark for inbound messages.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc4
+//
+func (s *Socket) SetRcvHWM(value int) error {
+ return s.SetSockOptInt(RCVHWM, value)
+}
+
+// ZMQ_AFFINITY: Set I/O thread affinity.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc5
+//
+func (s *Socket) SetAffinity(value uint64) error {
+ return s.SetSockOptUInt64(AFFINITY, value)
+}
+
+// ZMQ_SUBSCRIBE: Establish message filter.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc6
+//
+func (s *Socket) SetSubscribe(value string) error {
+ return s.SetSockOptString(SUBSCRIBE, value)
+}
+
+// ZMQ_UNSUBSCRIBE: Remove message filter.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc7
+//
+func (s *Socket) SetUnsubscribe(value string) error {
+ return s.SetSockOptString(UNSUBSCRIBE, value)
+}
+
+// ZMQ_IDENTITY: Set socket identity.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc8
+//
+func (s *Socket) SetIdentity(value string) error {
+ return s.SetSockOptString(IDENTITY, value)
+}
+
+// ZMQ_RATE: Set multicast data rate.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc9
+//
+func (s *Socket) SetRate(value int64) error {
+ return s.SetSockOptInt64(RATE, value)
+}
+
+// ZMQ_RECOVERY_IVL: Set multicast recovery interval.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc10
+//
+func (s *Socket) SetRecoveryIvl(value time.Duration) error {
+ return s.SetSockOptInt64(RECOVERY_IVL, int64(value/time.Millisecond))
+}
+
+// ZMQ_SNDBUF: Set kernel transmit buffer size.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc11
+//
+func (s *Socket) SetSndBuf(value uint64) error {
+ return s.SetSockOptUInt64(SNDBUF, value)
+}
+
+// ZMQ_RCVBUF: Set kernel receive buffer size.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc12
+//
+func (s *Socket) SetRcvBuf(value uint64) error {
+ return s.SetSockOptUInt64(RCVBUF, value)
+}
+
+// ZMQ_LINGER: Set linger period for socket shutdown.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc13
+//
+func (s *Socket) SetLinger(value time.Duration) error {
+ return s.SetSockOptInt(LINGER, int(value/time.Millisecond))
+}
+
+// ZMQ_RECONNECT_IVL: Set reconnection interval.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc14
+//
+func (s *Socket) SetReconnectIvl(value time.Duration) error {
+ return s.SetSockOptInt(RECONNECT_IVL, int(value/time.Millisecond))
+}
+
+// ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc15
+//
+func (s *Socket) SetReconnectIvlMax(value time.Duration) error {
+ return s.SetSockOptInt(RECONNECT_IVL_MAX, int(value/time.Millisecond))
+}
+
+// ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc16
+//
+func (s *Socket) SetBacklog(value int) error {
+ return s.SetSockOptInt(BACKLOG, value)
+}
+
+// ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc17
+//
+func (s *Socket) SetMaxMsgSize(value int64) error {
+ return s.SetSockOptInt64(MAXMSGSIZE, value)
+}
+
+// ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc19
+//
+func (s *Socket) SetRcvTimeout(value time.Duration) error {
+ return s.SetSockOptInt(RCVTIMEO, int(value/time.Millisecond))
+}
+
+// ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc20
+//
+func (s *Socket) SetSndTimeout(value time.Duration) error {
+ return s.SetSockOptInt(SNDTIMEO, int(value/time.Millisecond))
+}
+
+// ZMQ_IPV6: Enable IPv6 on socket.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc21
+//
+func (s *Socket) SetIpv6(value bool) error {
+ if value {
+ return s.SetSockOptInt(IPV6, 1)
+ }
+ return s.SetSockOptInt(IPV6, 0)
+}
+
+// ZMQ_IPV4ONLY: Use IPv4-only on socket.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc22
+//
+func (s *Socket) SetIPv4Only(value bool) error {
+ if value {
+ return s.SetSockOptInt(IPV4ONLY, 1)
+ }
+ return s.SetSockOptInt(IPV4ONLY, 0)
+}
+
+// ZMQ_IMMEDIATE: Queue messages only to completed connections.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc23
+//
+func (s *Socket) SetImmediate(value bool) error {
+ if value {
+ return s.SetSockOptInt(IMMEDIATE, 1)
+ }
+ return s.SetSockOptInt(IMMEDIATE, 0)
+}
+
+// ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc24
+//
+func (s *Socket) SetROUTERMandatory(value bool) error {
+ if value {
+ return s.SetSockOptInt(ROUTER_MANDATORY, 1)
+ }
+ return s.SetSockOptInt(ROUTER_MANDATORY, 0)
+}
+
+// ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc25
+//
+func (s *Socket) SetROUTERRaw(value int) error {
+ return s.SetSockOptInt(ROUTER_RAW, value)
+}
+
+// ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc26
+//
+func (s *Socket) SetProbeROUTER(value int) error {
+ return s.SetSockOptInt(PROBE_ROUTER, value)
+}
+
+// ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc27
+//
+func (s *Socket) SetXPUBVerbose(value bool) error {
+ if value {
+ return s.SetSockOptInt(XPUB_VERBOSE, 1)
+ }
+ return s.SetSockOptInt(XPUB_VERBOSE, 0)
+}
+
+// ZMQ_REQ_CORRELATE: match replies with requests.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc28
+//
+func (s *Socket) SetReqCorrelate(value int) error {
+ return s.SetSockOptInt(REQ_CORRELATE, value)
+}
+
+// ZMQ_REQ_RELAXED: relax strict alternation between request and reply.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc29
+//
+func (s *Socket) SetReqRelaxed(value int) error {
+ return s.SetSockOptInt(REQ_RELAXED, value)
+}
+
+// ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc30
+//
+func (s *Socket) SetTCPKeepalive(value int) error {
+ return s.SetSockOptInt(TCP_KEEPALIVE, value)
+}
+
+// ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT (or TCP_KEEPALIVE on some OS).
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc31
+//
+func (s *Socket) SetTCPKeepaliveIdle(value int) error {
+ return s.SetSockOptInt(TCP_KEEPALIVE_IDLE, value)
+}
+
+// ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc32
+//
+func (s *Socket) SetTCPKeepaliveCnt(value int) error {
+ return s.SetSockOptInt(TCP_KEEPALIVE_CNT, value)
+}
+
+// ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc33
+//
+func (s *Socket) SetTCPKeepaliveIntvl(value int) error {
+ return s.SetSockOptInt(TCP_KEEPALIVE_INTVL, value)
+}
+
+// ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc34
+//
+func (s *Socket) SetTCPAcceptFilter(value string) error {
+ return s.SetSockOptString(TCP_ACCEPT_FILTER, value)
+}
+
+// ZMQ_PLAIN_SERVER: Set PLAIN server role.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc35
+//
+func (s *Socket) SetPlainServer(value int) error {
+ return s.SetSockOptInt(PLAIN_SERVER, value)
+}
+
+// ZMQ_PLAIN_USERNAME: Set PLAIN security username.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc36
+//
+func (s *Socket) SetPlainUsername(value string) error {
+ return s.SetSockOptString(PLAIN_USERNAME, value)
+}
+
+// ZMQ_PLAIN_PASSWORD: Set PLAIN security password.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc37
+//
+func (s *Socket) SetPlainPassword(value string) error {
+ return s.SetSockOptString(PLAIN_PASSWORD, value)
+}
+
+// ZMQ_CURVE_SERVER: Set CURVE server role.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc38
+//
+func (s *Socket) SetCurveServer(value int) error {
+ return s.SetSockOptInt(CURVE_SERVER, value)
+}
+
+// ZMQ_CURVE_PUBLICKEY: Set CURVE public key.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc39
+//
+func (s *Socket) SetCurvePublickey(value string) error {
+ return s.SetSockOptString(CURVE_PUBLICKEY, value)
+}
+
+// ZMQ_CURVE_SECRETKEY: Set CURVE secret key.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc40
+//
+func (s *Socket) SetCurveSecretkey(value string) error {
+ return s.SetSockOptString(CURVE_SECRETKEY, value)
+}
+
+// ZMQ_CURVE_SERVERKEY: Set CURVE server key.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc41
+//
+func (s *Socket) SetCurveServerkey(value string) error {
+ return s.SetSockOptString(CURVE_SERVERKEY, value)
+}
+
+// ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc42
+//
+func (s *Socket) SetZapDomain(value string) error {
+ return s.SetSockOptString(ZAP_DOMAIN, value)
+}
+
+// ZMQ_CONFLATE: Keep only last message.
+//
+// See: http://api.zeromq.org/4.0:zmq-setsockopt#toc43
+//
+func (s *Socket) SetConflate(value bool) error {
+ if value {
+ return s.SetSockOptInt(CONFLATE, 1)
+ }
+ return s.SetSockOptInt(CONFLATE, 0)
+}
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org