Skip to content

woohgit/go-changelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    }

About

Golang Client for Changelog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages