top

Package draft provides a lightweight framework for distributed applications. It is based on a message bus featuring subscriptions based on message topics. On top of this Publish&Subscribe pattern a Remote Procedure Call (RPC) implementation has been built. Additionally, a message bus can be extended beyond localhost by linking them via network.

DRAFT started as a simple event delivery system as a part of my previous work on GoHome and has grown up to a "message broker" with routing and network capabilities, purely implemented in Go. From it's beginning (as an event system for home-automation) DRAFT has been designed with simplicity and extensibility in mind

Basics

Publish&Subscribe describes a software implementation allowing one party to be notified on specific events from another one. It is a common way of implementing the "Observer" pattern. Someone may also use the term message-broker if messages are distributed accross subscribers and can be delivered to applications running on different hosts. . Messages delivered across a DRAFT bus are encapsulated into the Event structure. Event Topics are simple strings that can be split into multiple "sub-topics" by including dots. For example, a topic could be "logging.system.info" or "logging.system.error".

Subscribers are registered to such topics and get notified when such an event occures. Subscriptions to topcis can be strict, matching the exact topic, or recursive, matching all sub-topics.

In addition to the Topic and Body properties, an event also includes information about it's origin, the bus domain it has been published to and optional header fields.

An application utilizing DRAFT can use one ore more dedicated messages buses and link them via subscribers if required. As a result, more complicated setups involving routing, filtering or proxying can ve implemented.

Installation

Upstream developmend of DRAFT is done on git.ppacher.at/paz/draft. However, stable version will be pushed to github.com/nethack42/draft.

In order to install the whole package just issue the following commands:

go get git.ppacher.at/paz/draft...

Package documentation is available within the source files or by using godoc tool.

godoc git.ppacher.at/paz/draft
godoc git.ppacher.at/paz/draft/rpc

Imported by 10 package(s)

  1. git.ppacher.at/home-os/home-os
  2. git.ppacher.at/home-os/home-os/actions
  3. git.ppacher.at/home-os/home-os/driver
  4. git.ppacher.at/home-os/home-os/plugin
  5. git.ppacher.at/home-os/home-os/trigger
  6. git.ppacher.at/paz/draft/connector
  7. git.ppacher.at/paz/draft/connector/ws
  8. git.ppacher.at/paz/draft/rpc
  9. git.ppacher.at/paz/draft/service
  10. git.ppacher.at/paz/draft/service/client

Imports 2 package(s)

  1. github.com/cihub/seelog
  2. github.com/Sirupsen/logrus

Test imports 1 package(s)

  1. github.com/stretchr/testify/assert