Skip to content

GrantStreetGroup/go-sentry-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Sentry API

godoc

This is a library that implements a client in go for the sentry api. It supports all the endpoints and can do a good bit. For a full reference you can check the godoc link above.

Usage

Initialization and Create New DSN Key

import (
	"fmt"

	"github.com/GrantStreetGroup/go-sentry-api"
)
// Auth token is always required, secondary is endpoint and third is timeout defaults 60 seconds
client, _:= sentry.NewClient("yourauthtokengoeshere", nil, nil)

// Fetch your organization
org, err := client.GetOrganization("sentry")
if err != nil {
	panic(err)
}

// Fetch a project you already made
project, err := client.GetProject(org, "my-project-slug")
if err != nil {
	panic(err)
}

// Create a new Client DSN via the API
key, err := client.CreateClientKey(org, project, "example-dsn")
if err != nil {
	panic(err)
}
fmt.Printf(key.DSN.Secret)

Installation

go get github.com/GrantStreetGroup/go-sentry-api

Documentation

godoc

Tests

To run tests you can setup a local sentry instance via docker. There is a makefile command called make devenv which will setup all of the containers.

Once complete you can then setup a environment var of SENTRY_AUTHTOKEN and then run make test which should go through and create and run all tests aginst localhost:8080

Contributors

Pull requests, issues and comments welcome. For pull requests:

  • Add tests for new features and bug fixes
  • Follow the existing style
  • Separate unrelated changes into multiple pull requests

License

Copyright (c) 2017 Atlassian and others. Apache 2.0 licensed, see LICENSE.txt file.

Packages

No packages published

Languages

  • Go 98.7%
  • Makefile 1.3%