sentry

package module
v0.0.0-...-a397cac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

# Go Sentry API
[![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)

**FORKED**: removed https://github.com/atlassian/go-sentry-api/issues/11 


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.

## Usage
### Initialization and Create New DSN Key
```go
import (
	"fmt"

	"github.com/atlassian/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/atlassian/go-sentry-api
```
## Documentation
[![godoc](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667 "Go Doc Reference")](https://godoc.org/github.com/atlassian/go-sentry-api)

## 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


See the existing issues for things to start contributing.
For bigger changes, make sure you start a discussion first by creating an issue and explaining the intended change.
Atlassian requires contributors to sign a Contributor License Agreement, known as a CLA. This serves as a record stating that the contributor is entitled to contribute the code/documentation/translation to the project and is willing to have it used in distributions and derivative works (or is willing to transfer ownership).

Prior to accepting your contributions we ask that you please follow the appropriate link below to digitally sign the CLA. The Corporate CLA is for those who are contributing as a member of an organization and the individual CLA is for those contributing as an individual.

* [CLA for corporate contributors](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=e1c17c66-ca4d-4aab-a953-2c231af4a20b)
* [CLA for individuals](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=3f94fbdc-2fbe-46ac-b14c-5d152700ae5d)

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

Documentation

Overview

Package sentry provides a client to access https://sentry.io/api and sentry instances apis.

Index

Constants

View Source
const (
	// DefaultHost is the default host that is used
	DefaultHost = "https://sentry.io"
	// DefaultEndpoint is the entry point for the api
	DefaultEndpoint = "/api/0/"
	// DefaultTimeout is the default timeout and is set to 60 seconds
	DefaultTimeout = time.Duration(60) * time.Second
)
View Source
const (
	// OrgEndpointName is set to roganizations
	OrgEndpointName = "organizations"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Detail     string `json:"detail,omitempty"`
	StatusCode int    `json:"-"`
}

APIError is used when the api returns back a non 200 response

func (APIError) Error

func (s APIError) Error() string

Error is the interface needed to transfor to a error type

type Activity

type Activity struct {
	Data        *map[string]interface{} `json:"data,omitempty"`
	DateCreated *time.Time              `json:"dateCreated,omitempty"`
	ID          *string                 `json:"id,omitempty"`
	Type        *string                 `json:"type,omitempty"`
	User        *InternalUser           `json:"user,omitempty"`
}

Activity is what current activity has happend on a issue

type Asset

type Asset struct {
	URL string `json:"url,omitempty"`
}

Asset is used from a plugin. Things like js/html

type Avatar

type Avatar struct {
	AvatarType *string `json:"avatarType,omitempty"`
	AvatarUUID *string `json:"avatarUuid,omitempty"`
}

Avatar is used for a users avatar

type Client

type Client struct {
	AuthToken  string
	Endpoint   string
	HTTPClient *http.Client
}

Client is used to talk to a sentry endpoint. Needs a auth token. If no endpoint this defaults to https://sentry.io/api/0/

func NewClient

func NewClient(authtoken string, endpoint *string, timeout *int) (*Client, error)

NewClient takes a auth token a optional endpoint and optional timeout and will return back a client and error

func (*Client) BulkDeleteIssues

func (c *Client) BulkDeleteIssues(o Organization, p Project, issues []string) error

BulkDeleteIssues takes a list of IDs and will delete them

func (*Client) BulkMutateIssues

func (c *Client) BulkMutateIssues(o Organization, p Project, req IssueBulkRequest, issues *[]string, status *Status) (IssueBulkResponse, error)

BulkMutateIssues takes a list of ids and optional status to filter through

func (*Client) CreateClientKey

func (c *Client) CreateClientKey(o Organization, p Project, name string) (Key, error)

CreateClientKey creates a new client key for a project and org

func (*Client) CreateOrganization

func (c *Client) CreateOrganization(orgname string) (Organization, error)

CreateOrganization creates a organization with a name

func (*Client) CreateProject

func (c *Client) CreateProject(o Organization, t Team, name string, slug *string) (Project, error)

CreateProject will create a new project in your org and team

func (*Client) CreateRelease

func (c *Client) CreateRelease(o Organization, p Project, r NewRelease) (Release, error)

CreateRelease will create a new release for a project in a org

func (*Client) CreateTeam

func (c *Client) CreateTeam(o Organization, name string, slug *string) (Team, error)

CreateTeam creates a team with a organization object and requires a name and a optional slug

func (*Client) DeleteClientKey

func (c *Client) DeleteClientKey(o Organization, p Project, k Key) error

DeleteClientKey deletes a client key for a project and org

func (*Client) DeleteIssue

func (c *Client) DeleteIssue(i Issue) error

DeleteIssue will delete an issue

func (*Client) DeleteOrganization

func (c *Client) DeleteOrganization(org Organization) error

DeleteOrganization will delete the Org. There is not way to revert this if you do.

func (*Client) DeleteProject

func (c *Client) DeleteProject(o Organization, p Project) error

DeleteProject will take your org, team, and proj and delete it from sentry.

func (*Client) DeleteRelease

func (c *Client) DeleteRelease(o Organization, p Project, r Release) error

DeleteRelease will delete the release from your project

func (*Client) DeleteReleaseFile

func (c *Client) DeleteReleaseFile(o Organization, p Project, r Release, f File) error

DeleteReleaseFile will remove the file from a sentry release

func (*Client) DeleteTeam

func (c *Client) DeleteTeam(o Organization, t Team) error

DeleteTeam deletes a team from a organization

func (*Client) GetClientKeys

func (c *Client) GetClientKeys(o Organization, p Project) ([]Key, error)

GetClientKeys fetches all client keys of the given project

func (*Client) GetIssue

func (c *Client) GetIssue(id string) (Issue, error)

GetIssue will fetch a issue by its ID as a string

func (*Client) GetIssueEvents

func (c *Client) GetIssueEvents(i Issue) ([]Event, *Link, error)

GetIssueEvents will fetch all events for a issue

func (*Client) GetIssueHashes

func (c *Client) GetIssueHashes(i Issue) ([]Hash, *Link, error)

GetIssueHashes will fetch all hashes for a issue

func (*Client) GetIssueTag

func (c *Client) GetIssueTag(i Issue, tagname string) (IssueTag, error)

GetIssueTag will fetch a tag used in a issue. Eg; environment, release, server

func (*Client) GetIssueTagValues

func (c *Client) GetIssueTagValues(i Issue, tag IssueTag) ([]IssueTagValue, *Link, error)

GetIssueTagValues will fetch all values for a issues tag

func (*Client) GetIssueTags

func (c *Client) GetIssueTags(i Issue) ([]IssueTag, *Link, error)

GetIssueTags will fetch all tags for a issue

func (*Client) GetIssues

func (c *Client) GetIssues(o Organization, p Project, StatsPeriod *string, ShortIDLookup *bool, query *string) ([]Issue, *Link, error)

GetIssues will fetch all issues for organization and project

func (*Client) GetLatestEvent

func (c *Client) GetLatestEvent(i Issue) (Event, error)

GetLatestEvent will fetch the latest event for a issue

func (*Client) GetOldestEvent

func (c *Client) GetOldestEvent(i Issue) (Event, error)

GetOldestEvent will fetch the latest event for a issue

func (*Client) GetOrgProjects

func (c *Client) GetOrgProjects(o Organization) ([]Project, *Link, error)

GetOrgProjects fetchs all projects belonging to a organization

func (*Client) GetOrganization

func (c *Client) GetOrganization(orgslug string) (Organization, error)

GetOrganization takes a org slug and returns back the org

func (*Client) GetOrganizationStats

func (c *Client) GetOrganizationStats(org Organization, stat StatQuery, since, until int64, resolution *string) ([]Stat, error)

GetOrganizationStats fetches stats from the org. Needs a Organization, a StatQuery, a timestamp in seconds since epoch and a optional resolution

func (*Client) GetOrganizationTeams

func (c *Client) GetOrganizationTeams(o Organization) ([]Team, error)

GetOrganizationTeams will fetch all teams for this org

func (*Client) GetOrganizationUsers

func (c *Client) GetOrganizationUsers(orgSlug string) ([]OrganizationUser, *Link, error)

GetOrganizations will return back every organization in the sentry instance

func (*Client) GetOrganizations

func (c *Client) GetOrganizations() ([]Organization, *Link, error)

GetOrganizations will return back every organization in the sentry instance

func (*Client) GetPage

func (c *Client) GetPage(p Page, out interface{}) (*Link, error)

GetPage will fetch a page via the Link object and decode it from out. Should be used like `client.GetPage(link.Previous, make([]Organization, 0))`

func (*Client) GetProject

func (c *Client) GetProject(o Organization, projslug string) (Project, error)

GetProject takes a project slug and returns back the project

func (*Client) GetProjectEvent

func (c *Client) GetProjectEvent(o Organization, p Project, eventID string) (Event, error)

GetProjectEvent will fetch a event on a project

func (*Client) GetProjectStats

func (c *Client) GetProjectStats(o Organization, p Project, stat StatQuery, since, until int64, resolution *string) ([]Stat, error)

GetProjectStats will fetch all stats for a specific project. Similar to GetOrganizationStats

func (*Client) GetProjectUserFeedback

func (c *Client) GetProjectUserFeedback(o Organization, p Project) ([]UserFeedback, *Link, error)

GetProjectUserFeedback is used to fetch all feedback given for a certain project

func (*Client) GetProjects

func (c *Client) GetProjects() ([]Project, *Link, error)

GetProjects fetchs all projects in a sentry instance

func (*Client) GetRelease

func (c *Client) GetRelease(o Organization, p Project, version string) (Release, error)

GetRelease will fetch a release from your org and project this does need a version string

func (*Client) GetReleaseFile

func (c *Client) GetReleaseFile(o Organization, p Project, r Release, id string) (File, error)

GetReleaseFile will get the release file

func (*Client) GetReleaseFiles

func (c *Client) GetReleaseFiles(o Organization, p Project, r Release) ([]File, error)

GetReleaseFiles will fetch all files in a release

func (*Client) GetReleases

func (c *Client) GetReleases(o Organization, p Project) ([]Release, *Link, error)

GetReleases will fetch all releases from your org and project

func (*Client) GetTeam

func (c *Client) GetTeam(o Organization, teamSlug string) (Team, error)

GetTeam takes a team slug and returns back the team

func (*Client) GetTeamProjects

func (c *Client) GetTeamProjects(o Organization, t Team) ([]Project, error)

GetTeamProjects fetchs all projects for a Team

func (*Client) GetTeamStats

func (c *Client) GetTeamStats(o Organization, t Team, stat StatQuery, since, until int64, resolution *string) ([]Stat, error)

GetTeamStats will fetch all stats for a specific team. Similar to GetOrganizationStats

func (*Client) GetTeams

func (c *Client) GetTeams(o Organization) ([]Team, *Link, error)

GetTeams will take a organization and retrieve a list of teams

func (*Client) SubmitUserFeedback

func (c *Client) SubmitUserFeedback(o Organization, p Project, u *UserFeedback) error

SubmitUserFeedback is used when you want to submit feedback to a organizations project

func (*Client) UpdateClientKey

func (c *Client) UpdateClientKey(o Organization, p Project, k Key, name string) (Key, error)

UpdateClientKey updates the name only of a key

func (*Client) UpdateIssue

func (c *Client) UpdateIssue(i Issue) error

UpdateIssue will update status, assign to, hasseen, isbookmarked and issubscribed

func (*Client) UpdateOrganization

func (c *Client) UpdateOrganization(org Organization) error

UpdateOrganization takes a organization and updates it on the server side

func (*Client) UpdateProject

func (c *Client) UpdateProject(o Organization, p Project) error

UpdateProject takes a organization and project then updates it on the server side

func (*Client) UpdateRelease

func (c *Client) UpdateRelease(o Organization, p Project, r Release) error

UpdateRelease will update ref, url, started, released for a release. Version should not change.

func (*Client) UpdateReleaseFile

func (c *Client) UpdateReleaseFile(o Organization, p Project, r Release, f File) error

UpdateReleaseFile will update just the name of the release file

func (*Client) UpdateTeam

func (c *Client) UpdateTeam(o Organization, t Team) error

UpdateTeam will update a team on the server side

func (*Client) UploadReleaseFile

func (c *Client) UploadReleaseFile(o Organization, p Project, r Release,
	name string, buffer io.Reader, header string) (File, error)

UploadReleaseFile will upload a file to release

type DSN

type DSN struct {
	Secret string `json:"secret,omitempty"`
	CSP    string `json:"csp,omitempty"`
	Public string `json:"public,omitempty"`
}

DSN is the actual connection strings used to send errors

type Entry

type Entry struct {
	Type string          `json:"type,omitempty"`
	Data json.RawMessage `json:"data,omitempty"`
}

Entry is the entry for the message/stacktrace/etc...

func (*Entry) GetInterface

func (e *Entry) GetInterface() (string, interface{}, error)

GetInterface will convert the entry into a go interface

type Event

type Event struct {
	EventID         string                  `json:"eventID,omitempty"`
	UserReport      *string                 `json:"userReport,omitempty"`
	NextEventID     *string                 `json:"nextEventID,omitempty"`
	PreviousEventID *string                 `json:"previousEventID,omitempty"`
	Message         *string                 `json:"message,omitempty"`
	ID              *string                 `json:"id,omitempty"`
	Size            *int                    `json:"size,omitempty"`
	Platform        *string                 `json:"platform,omitempty"`
	Type            *string                 `json:"type,omitempty"`
	Metadata        *map[string]string      `json:"metadata,omitempty"`
	Tags            *[]Tag                  `json:"tags,omitempty"`
	DateCreated     *time.Time              `json:"dateCreated,omitempty"`
	DateReceived    *time.Time              `json:"dateReceived,omitempty"`
	User            *User                   `json:"user,omitempty"`
	Entries         []Entry                 `json:"entries,omitempty"`
	Packages        *map[string]string      `json:"packages,omitempty"`
	SDK             *map[string]interface{} `json:"sdk,omitempty"`
	Contexts        *map[string]interface{} `json:"contexts,omitempty"`
	Context         *map[string]interface{} `json:"context,omitempty"`
	Release         *Release                `json:"release,omitempty"`
	GroupID         *string                 `json:"groupID,omitempty"`
}

Event is the event that was created on the app and sentry reported on

type File

type File struct {
	SHA1        string            `json:"sha1,omitempty"`
	Name        string            `json:"name,omitempty"`
	DateCreated time.Time         `json:"dateCreated,omitempty"`
	Headers     map[string]string `json:"headers,omitempty"`
	ID          string            `json:"id,omitempty"`
	Size        int               `json:"size,omitempty"`
}

File is used to create a new file for a release

type Hash

type Hash struct {
	ID string `json:"id,omitempty"`
}

Hash is returned via the issue_id/hashes

type InternalUser

type InternalUser struct {
	AvatarURL  *string    `json:"avatarUrl,omitempty"`
	DateJoined *time.Time `json:"dateJoined,omitempty"`
	Email      *string    `json:"email,omitempty"`
	Has2FA     *bool      `json:"has2fa,omitempty"`
	ID         *string    `json:"iD,omitempty"`
	IsActive   *bool      `json:"isActive,omitempty"`
	IsManaged  *bool      `json:"isManaged,omitempty"`
	LastLogin  *time.Time `json:"lastLogin,omitempty"`
	Name       *string    `json:"name,omitempty"`
	Username   *string    `json:"username,omitempty"`
}

InternalUser is a user on sentry and not a external customer

type Issue

type Issue struct {
	Annotations  *[]string               `json:"annotations,omitempty"`
	AssignedTo   *InternalUser           `json:"assignedTo,omitempty"`
	Activity     *[]Activity             `json:"activity,omitempty"`
	Count        *string                 `json:"count,omitempty"`
	Culprit      *string                 `json:"culprit,omitempty"`
	FirstSeen    *time.Time              `json:"firstSeen,omitempty"`
	HasSeen      *bool                   `json:"hasSeen,omitempty"`
	ID           *string                 `json:"id,omitempty"`
	IsBookmarked *bool                   `json:"isBookmarked,omitempty"`
	IsPublic     *bool                   `json:"isPublic,omitempty"`
	IsSubscribed *bool                   `json:"isSubscribed,omitempty"`
	LastSeen     *time.Time              `json:"lastSeen,omitempty"`
	Level        *string                 `json:"level,omitempty"`
	Logger       *string                 `json:"logger,omitempty"`
	Metadata     *map[string]interface{} `json:"metadata,omitempty"`
	NumComments  *int                    `json:"numComments,omitempty"`
	Permalink    *string                 `json:"permalink,omitempty"`
	Project      *Project                `json:"project,omitempty"`
	ShareID      *string                 `json:"shareId,omitempty"`
	ShortID      *string                 `json:"shortId,omitempty"`
	Stats        *IssueStats             `json:"stats,omitempty"`
	Status       *Status                 `json:"status,omitempty"`
	// TODO - we don't use this currently, and its unmarshaling is broken (and breaks issue loading)
	// StatusDetails       *map[string]string `json:"statusDetails,omitempty"`
	SubscriptionDetails *map[string]string `json:"subscriptionDetails,omitempty"`
	Tags                *[]IssueTag        `json:"tags,omitempty"`
	Title               *string            `json:"title,omitempty"`
	Type                *string            `json:"type,omitempty"`
	UserCount           *int               `json:"userCount,omitempty"`
	UserReportCount     *int               `json:"userReportCount,omitempty"`
}

Issue returns a issue found in sentry

type IssueBulkRequest

type IssueBulkRequest struct {
	Status         *Status `json:"status,omitempty"`
	IgnoreDuration *int    `json:"ignoreDuration,omitempty"`
	IsPublic       *bool   `json:"isPublic,omitempty"`
	Merge          *bool   `json:"merge,omitempty"`
	HasSeen        *bool   `json:"hasSeen,omitempty"`
	IsBookmarked   *bool   `json:"isBookmarked,omitempty"`
}

IssueBulkRequest is what should be used when bulk mutate issue

type IssueBulkResponse

type IssueBulkResponse struct {
	Status        *Status            `json:"status,omitempty"`
	IsPublic      *bool              `json:"isPublic,omitempty"`
	StatusDetails *map[string]string `json:"statusDetails,omitempty"`
}

IssueBulkResponse is what is returned when your mutation is done

type IssueStats

type IssueStats struct {
	TwentyFourHour *[]Stat `json:"24h,omitempty"`
	FourteenDays   *[]Stat `json:"14d,omitempty"`
	ThirtyDays     *[]Stat `json:"30d,omitempty"`
}

IssueStats is the stats of a issue

type IssueTag

type IssueTag struct {
	UniqueValues int             `json:"uniqueValues,omitempty"`
	ID           string          `json:"id,omitempty"`
	Key          string          `json:"key,omitempty"`
	Name         string          `json:"name,omitempty"`
	TopValues    []IssueTagValue `json:"topValues,omitempty"`
}

IssueTag is a tag used in a sentry issue

type IssueTagValue

type IssueTagValue struct {
	Count     *int64     `json:"count,omitempty"`
	FirstSeen *time.Time `json:"firstSeen,omitempty"`
	ID        *string    `json:"iD,omitempty"`
	Key       *string    `json:"key,omitempty"`
	LastSeen  *time.Time `json:"lastSeen,omitempty"`
	Name      *string    `json:"name,omitempty"`
	Value     *string    `json:"value,omitempty"`
}

IssueTagValue represents a tags value

type Key

type Key struct {
	Label       string    `json:"label,omitempty"`
	DSN         DSN       `json:"dsn,omitempty"`
	Secret      string    `json:"secret,omitempty"`
	ID          string    `json:"id,omitempty"`
	DateCreated time.Time `json:"dateCreated,omitempty"`
	Public      string    `json:"public,omitempty"`
}

Key is a DSN that sentry has made

type Link struct {
	Previous Page
	Next     Page
}

Link represents a link object as per: https://docs.sentry.io/api/pagination/

func NewLink(linkheader string) *Link

NewLink creates a new link object via the link header string

type NewRelease

type NewRelease struct {
	// Optional commit ref.
	Ref *string `json:"ref,omitempty"`

	// Optional URL to point to the online source code
	URL *string `json:"url,omitempty"`

	// Required for creating the release
	Version string `json:"version"`

	// Optional to set when it started
	DateStarted *time.Time `json:"dateStarted,omitempty"`

	// Optional to set when it was released to the public
	DateReleased *time.Time `json:"dateReleased,omitempty"`
}

NewRelease is used to create a new release

type Organization

type Organization struct {
	PendingAccessRequest *int       `json:"pendingAccessRequests,omitempty"`
	Slug                 *string    `json:"slug,omitempty"`
	Name                 string     `json:"name"`
	Quota                *Quota     `json:"quota,omitempty"`
	DateCreated          *time.Time `json:"dateCreated,omitempty"`
	Teams                *[]Team    `json:"teams,omitempty"`
	ID                   *string    `json:"id,omitempty"`
	IsEarlyAdopter       *bool      `json:"isEarlyAdopter,omitempty"`
	Features             *[]string  `json:"features,omitempty"`
}

Organization is your sentry organization.

type OrganizationUser

type OrganizationUser struct {
	User     InternalUser `json:"user"`
	Projects []string     `json:"projects"`
}

type Page

type Page struct {
	URL     string
	Results bool
}

Page is a link and if it has results or not

type Plugin

type Plugin struct {
	Assets     []Asset                `json:"assets,omitempty"`
	IsTestable bool                   `json:"isTestable,omitempty"`
	Enabled    bool                   `json:"enabled,omitempty"`
	Name       string                 `json:"name,omitempty"`
	CanDisable bool                   `json:"canDisable,omitempty"`
	Type       string                 `json:"type,omitempty"`
	ID         string                 `json:"id,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
}

Plugin is a type of project plugin

type Project

type Project struct {
	Status             string                  `json:"status,omitempty"`
	Slug               *string                 `json:"slug,omitempty"`
	DefaultEnvironment *string                 `json:"defaultEnvironment,omitempty"`
	Color              *string                 `json:"color,omitempty"`
	IsPublic           bool                    `json:"isPublic,omitempty"`
	DateCreated        *time.Time              `json:"dateCreated,omitempty"`
	CallSign           string                  `json:"callSign,omitempty"`
	FirstEvent         *time.Time              `json:"firstEvent,omitempty"`
	IsBookmarked       bool                    `json:"isBookmarked,omitempty"`
	CallSignReviewed   bool                    `json:"callSignReviewed,omitempty"`
	ID                 string                  `json:"id,omitempty"`
	Name               string                  `json:"name"`
	Platforms          *[]string               `json:"platforms,omitempty"`
	Options            *map[string]interface{} `json:"options,omitempty"`
	Plugins            *[]Plugin               `json:"plugins,omitempty"`
	Team               *Team                   `json:"team,omitempty"`
	Organization       *Organization           `json:"organization,omitempty"`
	DigestMinDelay     *int                    `json:"digestMinDelay,omitempty"`
	DigestMaxDelay     *int                    `json:"digestMaxDelay,omitempty"`
	VerifySSL          *bool                   `json:"verifySSL,omitempty"`
}

Project is your project in sentry

type QueryArgs

type QueryArgs interface {
	ToQueryString() string
}

QueryArgs is a simple internal interface

type Quota

type Quota struct {
	ProjectLimit int `json:"projectLimit"`
	MaxRate      int `json:"maxRate"`
}

Quota is your quote for a project limit and max rate

type Release

type Release struct {
	DateCreated  *time.Time `json:"dateCreated,omitempty"`
	DateReleased *time.Time `json:"dateReleased,omitempty"`
	DateStarted  *time.Time `json:"dateStarted,omitempty"`
	FirstEvent   *time.Time `json:"firstEvent,omitempty"`
	LastEvent    *time.Time `json:"lastEvent,omitempty"`
	NewGroups    *int       `json:"newGroups,omitempty"`
	Owner        *string    `json:"owner,omitempty"`
	Ref          *string    `json:"ref,omitempty"`
	ShortVersion string     `json:"shortVersion"`
	URL          *string    `json:"url,omitempty"`
	Version      string     `json:"version"`
}

Release is your release for a orgs teams project

type Stat

type Stat [2]float64

Stat is used for tetting a time in seconds and the metric in a float

type StatQuery

type StatQuery string

StatQuery is sample type for sending to /stats/ endpoints

const (
	// StatReceived is set to received for sending to /stats/ endpoints
	StatReceived StatQuery = "received"
	// StatRejected is set to rejected for sending to /stats/ endpoints
	StatRejected StatQuery = "rejected"
	// StatBlacklisted is set to blacklisted for sending to /stats/ endpoints
	StatBlacklisted StatQuery = "blacklisted"
)

type Status

type Status string

Status is used to make consts for statuses

const (
	// Resolved helps mark a issue or others as resolved
	Resolved Status = "resolved"
	// Unresolved helps mark a issue or others as unresolved
	Unresolved Status = "unresolved"
	// Ignored helps mark a issue or others as ignored
	Ignored Status = "ignored"
)

type Tag

type Tag struct {
	Value *string `json:"value,omitempty"`
	Key   *string `json:"key,omitempty"`
}

Tag is used for a event

type Team

type Team struct {
	Slug        *string    `json:"slug,omitempty"`
	Name        string     `json:"name"`
	HasAccess   *bool      `json:"hasAccess,omitempty"`
	IsPending   *bool      `json:"isPending,omitempty"`
	DateCreated *time.Time `json:"dateCreated,omitempty"`
	IsMember    *bool      `json:"isMember,omitempty"`
	ID          *string    `json:"id,omitempty"`
	Projects    *[]Project `json:"projects,omitempty"`
}

Team is a sentry team

type User

type User struct {
	Username *string `json:"username,omitempty"`
	Email    *string `json:"email,omitempty"`
	ID       *string `json:"id,omitempty"`
}

User is the user that was affected

type UserFeedback

type UserFeedback struct {
	EventID     *string    `json:"event_id,omitempty"`
	Name        *string    `json:"name,omitempty"`
	Comments    *string    `json:"comments,omitempty"`
	Email       *string    `json:"email,omitempty"`
	DateCreated *time.Time `json:"dateCreated,omitempty"`
	Issue       *Issue     `json:"issue,omitempty"`
	ID          *string    `json:"id,omitempty"`
}

UserFeedback is the feedback on a given project and issue

func NewUserFeedback

func NewUserFeedback(name, comments, email, eventID string) UserFeedback

NewUserFeedback will generate a new UserFeedback and type correctly

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL