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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Serving and sending protobufs from/to mesos via HTTP.
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
Config struct {
Port int // port to listen
ServerUrl string // server url to send events
Event struct {
Type string
Message proto.Message
Golligator struct {
NewGolligator(config *Config) *Golligator
NewGolligator creates new server with specified config
(g *Golligator) Listen() chan *Event
Listen creates new http listener and returns channel of incoming events
(g *Golligator) Send(event *Event)
Send event back to the server