Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdecool/go-mercure
Go client library for publishing an event through Mercure protocol
https://github.com/jdecool/go-mercure
Last synced: about 2 months ago
JSON representation
Go client library for publishing an event through Mercure protocol
- Host: GitHub
- URL: https://github.com/jdecool/go-mercure
- Owner: jdecool
- Created: 2020-04-13T21:50:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T21:21:35.000Z (over 4 years ago)
- Last Synced: 2024-06-20T03:26:23.094Z (7 months ago)
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
go-mercure
==========go-mercure is a Go client library for [Mercure](https://mercure.rocks).
## Usage
```go
import "github.com/jdecool/go-mercure/mercure"
```### Publish an event
```go
u, _ := url.Parse("https://localhost:3000/.well-known/mercure")
jwt := "my-jwt"m := mercure.Message{
Topics: []string{
"http://localhost/test",
},
Data: []byte("Hello World"),
}p := mercure.NewPublisher(u, jwt, nil)
evtId, err := p.Publish(m)
```