elodina/golligator

Name: golligator

Owner: Elodina

Description: null

Created: 2015-06-11 15:10:01.0

Updated: 2016-03-23 06:45:47.0

Pushed: 2015-06-12 12:12:48.0

Homepage: null

Size: 184

Language: Protocol Buffer

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

golligator

Serving and sending protobufs from/to mesos via HTTP.

Usage
age main

rt "github.com/stealthly/golligator"

 main() {
 Create config first, specify port to serve and url of remote server to respond
nfig := &golligator.Config{Port: 8081, ServerUrl: "http://remote.server.com"}
 Create Golligator from config
:= golligator.NewGolligator(config)
 Start server and get channel with incoming events
ents := g.Listen()
r {
event := <-events // Get event from channel
// ...
// Do actual work here
// ...
g.Send(event) // Send event back to the server


Reference
type Config
 Config struct {
Port      int    // port to listen
ServerUrl string // server url to send events

type Event
 Event struct {
Type    string
Message proto.Message

type Golligator
 Golligator struct {

func NewGolligator
 NewGolligator(config *Config) *Golligator

NewGolligator creates new server with specified config

func (*Golligator) Listen
 (g *Golligator) Listen() chan *Event

Listen creates new http listener and returns channel of incoming events

func (*Golligator) Send
 (g *Golligator) Send(event *Event)

Send event back to the server


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.