Skip to content

dpup/gohubbub

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

GoHubbub

A PubSubHubbub subscriber client library for Go (golang).

For API documentation see https://godoc.org/github.com/dpup/gohubbub

Example

gohubbub can start its own HTTP server:

import "github.com/dpup/gohubbub"

// ...

client := gohubbub.NewClient("mysite.com", "Testing")
client.DiscoverAndSubscribe(topicURL, func(contentType string, body []byte) {
  // Handle update notification.
})
client.StartAndServe("", 80)

Or if you have your own server, you can register the gohubbub request handler on your own mux and then call client.Run() when your server is running:

import "github.com/dpup/gohubbub"

// ...

client := gohubbub.NewClient("mysite.com", "Testing")
client.DiscoverAndSubscribe(topicURL, func(contentType string, body []byte) {
  // Handle update notification.
})
client.RegisterHandler(myMux)

// ...

client.Start()

See this simple program for a fully functioning example. You will need to run it from a machine that is publicly accessible or use reverse port forwarding from one that is.

Contributing

Questions, comments, bug reports, and pull requests are all welcome. Submit them on the project issue tracker.

License

Copyright 2014 Daniel Pupius. Licensed under the Apache License, Version 2.0.

About

A PubSubHubbub subscriber client library for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages