Skip to content

Commit 596f30f

Browse files
authored
Merge pull request #42 from atlassian/cwood/cleanup
Cleanup and fix badge
2 parents 3bb2fb7 + 6659374 commit 596f30f

File tree

9 files changed

+41
-40
lines changed

9 files changed

+41
-40
lines changed

README.mkd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Go Sentry API
2-
[![godoc](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 "Go Doc Reference")](https://godoc.org/github.com/atlassian/go-sentry-api) [![Build Status](https://travis-ci.org/atlassian/go-sentry-api.svg?branch=master)](https://travis-ci.org/atlassian/go-sentry-api)
2+
[![Go Reference](https://pkg.go.dev/badge/github.com/atlassian/go-sentry-api.svg)](https://pkg.go.dev/github.com/atlassian/go-sentry-api)
33

44

55
This is a library that implements a client in go for the [sentry api](http://www.sentry.io/api/). It supports all the endpoints and can do a good bit. For a full reference you can check the godoc link above.
66

77
## Usage
8+
89
### Initialization and Create New DSN Key
910
```go
1011
import (
@@ -40,7 +41,7 @@ fmt.Printf(key.DSN.Secret)
4041
go get github.com/atlassian/go-sentry-api
4142
```
4243
## Documentation
43-
[![godoc](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 "Go Doc Reference")](https://godoc.org/github.com/atlassian/go-sentry-api)
44+
[![Go Reference](https://pkg.go.dev/badge/github.com/atlassian/go-sentry-api.svg)](https://pkg.go.dev/github.com/atlassian/go-sentry-api)
4445

4546
## Tests
4647
To run tests you can setup a local sentry instance via docker. There is a

bulk.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"net/url"
66
)
77

8-
//IssueBulkRequest is what should be used when bulk mutate issue
8+
// IssueBulkRequest is what should be used when bulk mutate issue
99
type IssueBulkRequest struct {
1010
Status *Status `json:"status,omitempty"`
1111
IgnoreDuration *int `json:"ignoreDuration,omitempty"`
@@ -15,14 +15,14 @@ type IssueBulkRequest struct {
1515
IsBookmarked *bool `json:"isBookmarked,omitempty"`
1616
}
1717

18-
//IssueBulkResponse is what is returned when your mutation is done
18+
// IssueBulkResponse is what is returned when your mutation is done
1919
type IssueBulkResponse struct {
2020
Status *Status `json:"status,omitempty"`
2121
IsPublic *bool `json:"isPublic,omitempty"`
2222
StatusDetails *map[string]string `json:"statusDetails,omitempty"`
2323
}
2424

25-
//issueMutateArgs
25+
// issueMutateArgs
2626
type issueMutateArgs struct {
2727
ID *[]string
2828
Status *Status
@@ -41,7 +41,7 @@ func (i *issueMutateArgs) ToQueryString() string {
4141
return query.Encode()
4242
}
4343

44-
//BulkMutateIssues takes a list of ids and optional status to filter through
44+
// BulkMutateIssues takes a list of ids and optional status to filter through
4545
func (c *Client) BulkMutateIssues(o Organization, p Project, req IssueBulkRequest, issues *[]string, status *Status) (IssueBulkResponse, error) {
4646
var issueBulkResponse IssueBulkResponse
4747

@@ -56,7 +56,7 @@ func (c *Client) BulkMutateIssues(o Organization, p Project, req IssueBulkReques
5656
return issueBulkResponse, err
5757
}
5858

59-
//BulkDeleteIssues takes a list of IDs and will delete them
59+
// BulkDeleteIssues takes a list of IDs and will delete them
6060
func (c *Client) BulkDeleteIssues(o Organization, p Project, issues []string) error {
6161
mutateQuery := &issueMutateArgs{
6262
ID: &issues,

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (c *Client) doWithPagination(method, endpoint string, out, in interface{})
199199
return c.sendGetLink(request, out)
200200
}
201201

202-
//rawWithPagination is used when we need to get a raw URL vs a url we combine and comb with newrequest
202+
// rawWithPagination is used when we need to get a raw URL vs a url we combine and comb with newrequest
203203
func (c *Client) rawWithPagination(method, endpoint string, out, in interface{}) (*Link, error) {
204204
request, err := c.rawRequest(method, endpoint, in)
205205
if err != nil {

events.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Tag struct {
1414
Key *string `json:"key,omitempty"`
1515
}
1616

17-
//User is the user that was affected
17+
// User is the user that was affected
1818
type User struct {
1919
Username *string `json:"username,omitempty"`
2020
Email *string `json:"email,omitempty"`
@@ -31,7 +31,7 @@ type Entry struct {
3131
Data json.RawMessage `json:"data,omitempty"`
3232
}
3333

34-
//GetInterface will convert the entry into a go interface
34+
// GetInterface will convert the entry into a go interface
3535
func (e *Entry) GetInterface() (string, interface{}, error) {
3636
var destination interface{}
3737

@@ -90,14 +90,14 @@ func (c *Client) GetProjectEvent(o Organization, p Project, eventID string) (Eve
9090
return event, err
9191
}
9292

93-
//GetLatestEvent will fetch the latest event for a issue
93+
// GetLatestEvent will fetch the latest event for a issue
9494
func (c *Client) GetLatestEvent(i Issue) (Event, error) {
9595
var event Event
9696
err := c.do("GET", fmt.Sprintf("issues/%s/events/latest", *i.ID), &event, nil)
9797
return event, err
9898
}
9999

100-
//GetOldestEvent will fetch the latest event for a issue
100+
// GetOldestEvent will fetch the latest event for a issue
101101
func (c *Client) GetOldestEvent(i Issue) (Event, error) {
102102
var event Event
103103
err := c.do("GET", fmt.Sprintf("issues/%s/events/oldest", *i.ID), &event, nil)

file.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
//File is used to create a new file for a release
13+
// File is used to create a new file for a release
1414
type File struct {
1515
SHA1 string `json:"sha1,omitempty"`
1616
Name string `json:"name,omitempty"`
@@ -20,7 +20,7 @@ type File struct {
2020
Size int `json:"size,omitempty"`
2121
}
2222

23-
//UploadReleaseFile will upload a file to release
23+
// UploadReleaseFile will upload a file to release
2424
func (c *Client) UploadReleaseFile(o Organization, p Project, r Release,
2525
name string, buffer io.Reader, header string) (File, error) {
2626
var file File
@@ -69,19 +69,19 @@ func (c *Client) DeleteReleaseFile(o Organization, p Project, r Release, f File)
6969
nil, nil)
7070
}
7171

72-
//UpdateReleaseFile will update just the name of the release file
72+
// UpdateReleaseFile will update just the name of the release file
7373
func (c *Client) UpdateReleaseFile(o Organization, p Project, r Release, f File) error {
7474
return c.do("PUT", fmt.Sprintf("projects/%s/%s/releases/%s/files/%s", *o.Slug, *p.Slug, r.Version, f.ID), &f, &f)
7575
}
7676

77-
//GetReleaseFiles will fetch all files in a release
77+
// GetReleaseFiles will fetch all files in a release
7878
func (c *Client) GetReleaseFiles(o Organization, p Project, r Release) ([]File, error) {
7979
var files []File
8080
err := c.do("GET", fmt.Sprintf("projects/%s/%s/releases/%s/files", *o.Slug, *p.Slug, r.Version), &files, nil)
8181
return files, err
8282
}
8383

84-
//GetReleaseFile will get the release file
84+
// GetReleaseFile will get the release file
8585
func (c *Client) GetReleaseFile(o Organization, p Project, r Release, id string) (File, error) {
8686
var file File
8787
err := c.do("GET", fmt.Sprintf("projects/%s/%s/releases/%s/files/%s", *o.Slug, *p.Slug, r.Version, id), &file, nil)

issue.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type IssueStats struct {
3131
ThirtyDays *[]Stat `json:"30d,omitempty"`
3232
}
3333

34-
//IssueTagValue represents a tags value
34+
// IssueTagValue represents a tags value
3535
type IssueTagValue struct {
3636
Count *int64 `json:"count,omitempty"`
3737
FirstSeen *time.Time `json:"firstSeen,omitempty"`
@@ -51,13 +51,13 @@ type IssueTag struct {
5151
TopValues []IssueTagValue `json:"topValues,omitempty"`
5252
}
5353

54-
//Avatar is used for a users avatar
54+
// Avatar is used for a users avatar
5555
type Avatar struct {
5656
AvatarType *string `json:"avatarType,omitempty"`
5757
AvatarUUID *string `json:"avatarUuid,omitempty"`
5858
}
5959

60-
//InternalUser is a user on sentry and not a external customer
60+
// InternalUser is a user on sentry and not a external customer
6161
type InternalUser struct {
6262
AvatarURL *string `json:"avatarUrl,omitempty"`
6363
DateJoined *time.Time `json:"dateJoined,omitempty"`
@@ -71,7 +71,7 @@ type InternalUser struct {
7171
Username *string `json:"username,omitempty"`
7272
}
7373

74-
//Activity is what current activity has happend on a issue
74+
// Activity is what current activity has happend on a issue
7575
type Activity struct {
7676
Data *map[string]interface{} `json:"data,omitempty"`
7777
DateCreated *time.Time `json:"dateCreated,omitempty"`
@@ -134,7 +134,7 @@ func (i *issueQuery) ToQueryString() string {
134134
return query.Encode()
135135
}
136136

137-
//GetIssues will fetch all issues for organization and project
137+
// GetIssues will fetch all issues for organization and project
138138
func (c *Client) GetIssues(o Organization, p Project, StatsPeriod *string, ShortIDLookup *bool, query *string) ([]Issue, *Link, error) {
139139
var issues []Issue
140140

@@ -149,54 +149,54 @@ func (c *Client) GetIssues(o Organization, p Project, StatsPeriod *string, Short
149149
return issues, link, err
150150
}
151151

152-
//GetIssue will fetch a issue by its ID as a string
152+
// GetIssue will fetch a issue by its ID as a string
153153
func (c *Client) GetIssue(id string) (Issue, error) {
154154
var issue Issue
155155
err := c.do("GET", fmt.Sprintf("issues/%s", id), &issue, nil)
156156
return issue, err
157157
}
158158

159-
//GetIssueHashes will fetch all hashes for a issue
159+
// GetIssueHashes will fetch all hashes for a issue
160160
func (c *Client) GetIssueHashes(i Issue) ([]Hash, *Link, error) {
161161
var hashes []Hash
162162
link, err := c.doWithPagination("GET", fmt.Sprintf("issues/%s/hashes", *i.ID), &hashes, nil)
163163
return hashes, link, err
164164
}
165165

166-
//GetIssueTags will fetch all tags for a issue
166+
// GetIssueTags will fetch all tags for a issue
167167
func (c *Client) GetIssueTags(i Issue) ([]IssueTag, *Link, error) {
168168
var tags []IssueTag
169169
link, err := c.doWithPagination("GET", fmt.Sprintf("issues/%s/tags", *i.ID), &tags, nil)
170170
return tags, link, err
171171
}
172172

173-
//GetIssueTag will fetch a tag used in a issue. Eg; environment, release, server
173+
// GetIssueTag will fetch a tag used in a issue. Eg; environment, release, server
174174
func (c *Client) GetIssueTag(i Issue, tagname string) (IssueTag, error) {
175175
var tag IssueTag
176176
err := c.do("GET", fmt.Sprintf("issues/%s/tags/%s", *i.ID, tagname), &tag, nil)
177177
return tag, err
178178
}
179179

180-
//GetIssueTagValues will fetch all values for a issues tag
180+
// GetIssueTagValues will fetch all values for a issues tag
181181
func (c *Client) GetIssueTagValues(i Issue, tag IssueTag) ([]IssueTagValue, *Link, error) {
182182
var values []IssueTagValue
183183
link, err := c.doWithPagination("GET", fmt.Sprintf("issues/%s/tags/%s/values", *i.ID, tag.Key), &values, nil)
184184
return values, link, err
185185
}
186186

187-
//GetIssueEvents will fetch all events for a issue
187+
// GetIssueEvents will fetch all events for a issue
188188
func (c *Client) GetIssueEvents(i Issue) ([]Event, *Link, error) {
189189
var events []Event
190190
link, err := c.doWithPagination("GET", fmt.Sprintf("issues/%s/events", *i.ID), &events, nil)
191191
return events, link, err
192192
}
193193

194-
//UpdateIssue will update status, assign to, hasseen, isbookmarked and issubscribed
194+
// UpdateIssue will update status, assign to, hasseen, isbookmarked and issubscribed
195195
func (c *Client) UpdateIssue(i Issue) error {
196196
return c.do("PUT", fmt.Sprintf("issues/%s", *i.ID), &i, &i)
197197
}
198198

199-
//DeleteIssue will delete an issue
199+
// DeleteIssue will delete an issue
200200
func (c *Client) DeleteIssue(i Issue) error {
201201
return c.do("DELETE", fmt.Sprintf("issues/%s", *i.ID), nil, nil)
202202
}

keys.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type nameReq struct {
3333
Name string `json:"name"`
3434
}
3535

36-
//CreateClientKey creates a new client key for a project and org
36+
// CreateClientKey creates a new client key for a project and org
3737
func (c *Client) CreateClientKey(o Organization, p Project, name string) (Key, error) {
3838
var key Key
3939
req := &nameReq{
@@ -43,12 +43,12 @@ func (c *Client) CreateClientKey(o Organization, p Project, name string) (Key, e
4343
return key, err
4444
}
4545

46-
//DeleteClientKey deletes a client key for a project and org
46+
// DeleteClientKey deletes a client key for a project and org
4747
func (c *Client) DeleteClientKey(o Organization, p Project, k Key) error {
4848
return c.do("DELETE", fmt.Sprintf("projects/%s/%s/keys/%s", *o.Slug, *p.Slug, k.ID), nil, nil)
4949
}
5050

51-
//UpdateClientKey updates the name only of a key
51+
// UpdateClientKey updates the name only of a key
5252
func (c *Client) UpdateClientKey(o Organization, p Project, k Key, name string) (Key, error) {
5353
var key Key
5454
req := &nameReq{
@@ -58,7 +58,7 @@ func (c *Client) UpdateClientKey(o Organization, p Project, k Key, name string)
5858
return key, err
5959
}
6060

61-
//GetClientKeys fetches all client keys of the given project
61+
// GetClientKeys fetches all client keys of the given project
6262
func (c *Client) GetClientKeys(o Organization, p Project) ([]Key, error) {
6363
var keys []Key
6464
err := c.do("GET", fmt.Sprintf("projects/%s/%s/keys", *o.Slug, *p.Slug), &keys, nil)

release.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ func (c *Client) GetReleases(o Organization, p Project) ([]Release, *Link, error
5252
return rel, link, err
5353
}
5454

55-
//CreateRelease will create a new release for a project in a org
55+
// CreateRelease will create a new release for a project in a org
5656
func (c *Client) CreateRelease(o Organization, p Project, r NewRelease) (Release, error) {
5757
var rel Release
5858
err := c.do("POST", fmt.Sprintf("projects/%s/%s/releases", *o.Slug, *p.Slug), &rel, &r)
5959
return rel, err
6060
}
6161

62-
//UpdateRelease will update ref, url, started, released for a release.
63-
//Version should not change.
62+
// UpdateRelease will update ref, url, started, released for a release.
63+
// Version should not change.
6464
func (c *Client) UpdateRelease(o Organization, p Project, r Release) error {
6565
return c.do("PUT", fmt.Sprintf("projects/%s/%s/releases/%s", *o.Slug, *p.Slug, r.Version), &r, &r)
6666
}
6767

68-
//DeleteRelease will delete the release from your project
68+
// DeleteRelease will delete the release from your project
6969
func (c *Client) DeleteRelease(o Organization, p Project, r Release) error {
7070
return c.do("DELETE", fmt.Sprintf("projects/%s/%s/releases/%s", *o.Slug, *p.Slug, r.Version), nil, nil)
7171
}

userfeedback.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ func NewUserFeedback(name, comments, email, eventID string) UserFeedback {
2626
}
2727
}
2828

29-
//SubmitUserFeedback is used when you want to submit feedback to a organizations project
29+
// SubmitUserFeedback is used when you want to submit feedback to a organizations project
3030
func (c *Client) SubmitUserFeedback(o Organization, p Project, u *UserFeedback) error {
3131
return c.do("POST", fmt.Sprintf("projects/%s/%s/user-feedback", *o.Slug, *p.Slug), &u, &u)
3232
}
3333

34-
//GetProjectUserFeedback is used to fetch all feedback given for a certain project
34+
// GetProjectUserFeedback is used to fetch all feedback given for a certain project
3535
func (c *Client) GetProjectUserFeedback(o Organization, p Project) ([]UserFeedback, *Link, error) {
3636
var feedback []UserFeedback
3737
link, err := c.doWithPagination("GET", fmt.Sprintf("projects/%s/%s/user-feedback", *o.Slug, *p.Slug), &feedback, nil)

0 commit comments

Comments
 (0)