sentrymock

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sentrymock is a fake of the part of Sentry's web API that kōjō reads (internal/surfaces/sentry): an organization and its issues. The development stacks run it (cmd/sentrymock) as alerts.sentry.base_url, so an alert that the end-to-end scenarios deliver is enriched as Sentry would enrich it, with no Sentry account.

Every issue whose ID is a number exists in the configured organization: its short ID is the prefix followed by the number, it is unresolved, and it was seen 3 times by 2 users. The API answers only the configured bearer token. Webhook deliveries are not sent from here: the scenarios sign and send them themselves, so they can also send a bad signature.

Index

Constants

View Source
const DefaultShortIDPrefix = "E2E-"

DefaultShortIDPrefix starts every issue's short ID when Options sets none.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is the fake API, an http.Handler.

func New

func New(o Options) *Mock

New returns the mock.

func (*Mock) Reads

func (m *Mock) Reads(id string) int

Reads reports how many times the API answered for the issue.

func (*Mock) ServeHTTP

func (m *Mock) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	// Org is the organization slug the API answers for. Required.
	Org string
	// Token is the only bearer token the API accepts; any token when empty.
	Token string
	// ShortIDPrefix starts each issue's short ID (DefaultShortIDPrefix when
	// empty).
	ShortIDPrefix string
	Logger        *slog.Logger
}

Options configures the mock.

Directories

Path Synopsis
cmd
sentrymock command
Command sentrymock serves the fake Sentry API of package sentrymock: the alerts.sentry.base_url of the development stacks (make dev-sbx, make dev-kind).
Command sentrymock serves the fake Sentry API of package sentrymock: the alerts.sentry.base_url of the development stacks (make dev-sbx, make dev-kind).

Jump to

Keyboard shortcuts

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