Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpup/gohubbub
A PubSubHubbub subscriber client library for Go
https://github.com/dpup/gohubbub
Last synced: 9 days ago
JSON representation
A PubSubHubbub subscriber client library for Go
- Host: GitHub
- URL: https://github.com/dpup/gohubbub
- Owner: dpup
- License: other
- Created: 2014-02-02T09:03:59.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-17T23:50:59.000Z (over 10 years ago)
- Last Synced: 2024-10-14T18:11:49.547Z (23 days ago)
- Language: Go
- Homepage:
- Size: 225 KB
- Stars: 32
- Watchers: 5
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
GoHubbub
========A [PubSubHubbub](https://pubsubhubbub.googlecode.com/) 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:
```go
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:```go
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](./example/example.go) for a fully functioning example.
You will need to run it from a machine that is publicly accessible or use
[reverse port forwarding](https://medium.com/dev-tricks/220030f3c84a) from one
that is.Contributing
------------
Questions, comments, bug reports, and pull requests are all welcome. Submit
them [on the project issue tracker](https://github.com/dpup/gohubbub/issues/new).License
-------
Copyright 2014 [Daniel Pupius](http://pupius.co.uk). Licensed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).