zeroless

package module
v0.0.0-...-5381578 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2016 License: LGPL-2.1 Imports: 3 Imported by: 0

README

Zeroless

Build Status Coverage Status GoDoc License

Yet another ØMQ wrapper for Go. However, differing from zmq4, which tries to stay very close to the C++ implementation, this project aims to make distributed systems employing ØMQ as gopher as possible.

Being simpler to use, Zeroless doesn't supports all of the fine aspects and features of ØMQ. However, you can expect to find all the message passing patterns you were accustomed to (i.e. pair, request/reply, publisher/subscriber, push/pull). Despite that, the only transport available is TCP.

Installation

Use go get:

$ go get github.com/zmqless/go-zeroless

Go API

In the zeroless package, two structs can be used to define how distributed entities are related (i.e. Server and Client). To put it bluntly, with the exception of the pair pattern, a client may be connected to multiple servers, while a server may accept incoming connections from multiple clients.

Both servers and clients are able to create a channel. So that you can iterate over incoming messages and/or transmit a message.

Testing

To run all the tests:

$ go test

License

Copyright 2015 Lucas Lira Gomes x8lucas8x@gmail.com

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Ip   string
	Port int
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() *Client

func (Client) Addresses

func (this Client) Addresses() []Address

func (*Client) Connect

func (this *Client) Connect(ip string, port int) error

func (*Client) ConnectLocal

func (this *Client) ConnectLocal(port int) error

func (*Client) Disconnect

func (this *Client) Disconnect(ip string, port int) error

func (*Client) DisconnectLocal

func (this *Client) DisconnectLocal(port int) error

func (*Client) Pair

func (this *Client) Pair() (chan []string, error)

func (*Client) Pub

func (this *Client) Pub() (chan<- []string, error)

func (*Client) PubWithTopic

func (this *Client) PubWithTopic(topic string, embedTopic bool) (chan<- []string, error)

func (*Client) Pull

func (this *Client) Pull() (<-chan []string, error)

func (*Client) Push

func (this *Client) Push() (chan<- []string, error)

func (Client) Ready

func (this Client) Ready() bool

func (*Client) Rep

func (this *Client) Rep() (chan []string, error)

func (*Client) Req

func (this *Client) Req() (chan []string, error)

func (*Client) Sub

func (this *Client) Sub() (<-chan []string, error)

func (*Client) SubWithTopics

func (this *Client) SubWithTopics(topics []string) (<-chan []string, error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(port int) *Server

func (*Server) Pair

func (this *Server) Pair() (chan []string, error)

func (*Server) Pub

func (this *Server) Pub() (chan<- []string, error)

func (*Server) PubWithTopic

func (this *Server) PubWithTopic(topic string, embedTopic bool) (chan<- []string, error)

func (*Server) Pull

func (this *Server) Pull() (<-chan []string, error)

func (*Server) Push

func (this *Server) Push() (chan<- []string, error)

func (Server) Ready

func (this Server) Ready() bool

func (*Server) Rep

func (this *Server) Rep() (chan []string, error)

func (*Server) Req

func (this *Server) Req() (chan []string, error)

func (*Server) Sub

func (this *Server) Sub() (<-chan []string, error)

func (*Server) SubWithTopics

func (this *Server) SubWithTopics(topics []string) (<-chan []string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL