Documentation
¶
Overview ¶
Package sentry provides a thin client for the Sentry REST API. Only the operations required by the operator are implemented.
Index ¶
- type APIError
- type Client
- func (c *Client) CreateKey(ctx context.Context, org, slug, name string) (*DSNKey, error)
- func (c *Client) CreateProject(ctx context.Context, org, team, name, slug, platform string) (*Project, error)
- func (c *Client) DeleteProject(ctx context.Context, org, slug string) error
- func (c *Client) GetProject(ctx context.Context, org, slug string) (*Project, error)
- func (c *Client) GetProjectDSN(ctx context.Context, org, slug string) (string, error)
- func (c *Client) ListKeys(ctx context.Context, org, slug string) ([]DSNKey, error)
- func (c *Client) UpdateKeyRateLimit(ctx context.Context, org, slug, keyID string, count, window int) error
- type DSNKey
- type Project
- type RateLimit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a minimal Sentry API client.
func NewClient ¶
NewClient creates a new Sentry API client. baseURL should be "https://sentry.io" for Sentry Cloud, or your self-hosted URL. token is a Sentry auth token with project:write and project:read scopes.
func (*Client) CreateProject ¶
func (c *Client) CreateProject(ctx context.Context, org, team, name, slug, platform string) (*Project, error)
CreateProject creates a new project under the given team and returns it.
func (*Client) DeleteProject ¶
DeleteProject deletes a Sentry project.
func (*Client) GetProject ¶
GetProject retrieves a project by slug. Returns nil, nil if the project does not exist.
func (*Client) GetProjectDSN ¶
GetProjectDSN returns the public DSN for the first client key of the project.
type DSNKey ¶
type DSNKey struct {
ID string `json:"id"`
Label string `json:"label"`
DSN dsnData `json:"dsn"`
RateLimit RateLimit `json:"rateLimit"`
}
DSNKey represents a Sentry client key (DSN).