Documentation ¶
Overview ¶
Package zmqutil - various comm ZMq routines shared be all commands
Index ¶
- Constants
- func CloseClients(clients []Client)
- func MakeKeyPair(publicKeyFileName string, privateKeyFileName string) error
- func NewBind(log *logger.L, socketType zmq.Type, zapDomain string, privateKey []byte, ...) (*zmq.Socket, *zmq.Socket, error)
- func NewMonitor(socket *zmq.Socket, connection string, event zmq.Event) (*zmq.Socket, error)
- func NewServerSocket(socketType zmq.Type, zapDomain string, privateKey []byte, publicKey []byte, ...) (*zmq.Socket, error)
- func NewSignalPair(signal string) (receiver *zmq.Socket, sender *zmq.Socket, err error)
- func ParseKey(data string) ([]byte, bool, error)
- func ReadPrivateKey(key string) ([]byte, error)
- func ReadPublicKey(key string) ([]byte, error)
- func StartAuthentication() error
- type Client
- type Connected
- type Event
Constants ¶
const ( EVENT_CONNECTED = zmq.EVENT_CONNECTED EVENT_CONNECT_DELAYED = zmq.EVENT_CONNECT_DELAYED EVENT_CONNECT_RETRIED = zmq.EVENT_CONNECT_RETRIED EVENT_LISTENING = zmq.EVENT_LISTENING EVENT_BIND_FAILED = zmq.EVENT_BIND_FAILED EVENT_ACCEPTED = zmq.EVENT_ACCEPTED EVENT_ACCEPT_FAILED = zmq.EVENT_ACCEPT_FAILED EVENT_CLOSED = zmq.EVENT_CLOSED EVENT_CLOSE_FAILED = zmq.EVENT_CLOSE_FAILED EVENT_DISCONNECTED = zmq.EVENT_DISCONNECTED EVENT_MONITOR_STOPPED = zmq.EVENT_MONITOR_STOPPED EVENT_ALL = zmq.EVENT_ALL // ***** FIX THIS: not defined by zmq EVENT_HANDSHAKE_FAILED_NO_DETAIL = 0x0800 EVENT_HANDSHAKE_SUCCEEDED = 0x1000 EVENT_HANDSHAKE_FAILED_PROTOCOL = 0x2000 EVENT_HANDSHAKE_FAILED_AUTH = 0x4000 )
re-export zmq constants
Variables ¶
This section is empty.
Functions ¶
func CloseClients ¶
func CloseClients(clients []Client)
CloseClients - disconnect old addresses and close all
func MakeKeyPair ¶
MakeKeyPair - create a new public/private keypair and write them to separate files
func NewBind ¶
func NewBind(log *logger.L, socketType zmq.Type, zapDomain string, privateKey []byte, publicKey []byte, listen []*util.Connection) (*zmq.Socket, *zmq.Socket, error)
NewBind - bind socket to a list of addresses creates up to 2 sockets for separate IPv4 and IPv6 traffic
func NewMonitor ¶ added in v0.7.3
NewMonitor - return a socket connection to the monitoring channel of another socket for connection state signalling a unique inproc://name must be provided for each use
func NewServerSocket ¶
func NewServerSocket(socketType zmq.Type, zapDomain string, privateKey []byte, publicKey []byte, v6 bool) (*zmq.Socket, error)
NewServerSocket - create a socket suitable for a server side connection
func NewSignalPair ¶
NewSignalPair -return a pair of connected PAIR sockets for shutdown signalling
func ReadPrivateKey ¶ added in v0.9.0
ReadPrivateKey - extract the private key from a string returning it as a 32 byte string
func ReadPublicKey ¶ added in v0.9.0
ReadPublicKey - extract the public key from a string returning it as a 32 byte string
func StartAuthentication ¶
func StartAuthentication() error
StartAuthentication - initialise the ZMQ security subsystem
Types ¶
type Client ¶
type Client interface { Close() error Connect(conn *util.Connection, serverPublicKey []byte, prefix string) error ConnectedTo() *Connected GoString() string IsConnected() bool IsConnectedTo(serverPublicKey []byte) bool Reconnect() error Receive(flags zmq.Flag) ([][]byte, error) Send(items ...interface{}) error ServerPublicKey() []byte String() string }
Client - structure to hold a client connection