broker

package
v0.0.0-...-d8adf2a Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Broker is a local broker responsible for routing messages to and from remote services. There is one broker started per remote service.

Discovery is responsible for watching registered service nodes. It is tightly connected with Broker and is started along with it (i.e. per one remote service).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(service string) error

Types

type Broker

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

func (*Broker) Start

func (b *Broker) Start() error

func (*Broker) Stop

func (b *Broker) Stop()

type Discovery

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

func NewDiscovery

func NewDiscovery(service string, nodesManager NodesManager, nodeCommand, nodeResponse chan NodeMessage, nextNode chan string) *Discovery

func (*Discovery) Start

func (d *Discovery) Start()

type Message

type Message int
const (
	CONNECT Message = iota
	DISCONNECT
	PING
	PONG
)

type Node

type Node struct {
	Uri        string
	Alive      bool
	Registered bool
}

type NodeMessage

type NodeMessage struct {
	Message Message
	Uri     string
}

type NodesManager

type NodesManager interface {
	ServiceNodes(service string) ([]string, error)
}

Jump to

Keyboard shortcuts

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