go-changelog is a simple package to send events to a changelog server. Examples can be found below.
For more detail about the library and its features, reference your local godoc once installed.
Contributions welcome!
go get github.com/woohgit/go-changelog
- INFO
- NOTIFICATION
- WARNING
- ERROR
- CRITICAL
- Custom fields in the message for custom changelog server
- Custom headers
- Support for BasicAuth
package main
import (
"github.com/woohgit/go-changelog"
)
func main() {
// if the port is standard 443/80 just pass an empty string ""
c := changelog.New("https://changelog.yourdomain.tld", "8081", "/api/events", "misc", "INFO") // Build our new changelog client
response, err := c.Send("Our server is behind https and listens on the port 8081!")
if err != nil {
// recover
} else {
// everything worked fine
}
}
c.UseBasicAuth("username", "password")
response, err := c.Send("Server is behind BasicAuth!")
if err != nil {
// recover
} else {
// everything worked fine
}
extraFields := map[string]string{"environment": "production"}
c.AddExtraFields(extraFields)
response, err := c.Send("Our server supports the environment field too!")
if err != nil {
// recover
} else {
// everything worked fine
}