Golang Client for Changelog
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
Gomfile
LICENSE
README.md
changelog.go
changelog_test.go

README.md

go-changelog

GoDoc Build Status

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!

Installation

go get github.com/woohgit/go-changelog

Available Severities

  1. INFO
  2. NOTIFICATION
  3. WARNING
  4. ERROR
  5. CRITICAL

Features

  • Custom fields in the message for custom changelog server
  • Custom headers
  • Support for BasicAuth

Examples

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
    }

}

Use BasicAuth

c.UseBasicAuth("username", "password")
response, err := c.Send("Server is behind BasicAuth!")
	if err != nil {
    	// recover
    } else {
    	// everything worked fine
    }

Use Custom Fields

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
    }