util

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 7 Imported by: 0 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

Index

Constants

View Source
const MaxDrainResponseBytes = 16 << 10

MaxDrainResponseBytes is the maximum number of bytes that transport implementations will read from response bodies when draining them.

Variables

This section is empty.

Functions

func EnvelopeIdentifier

func EnvelopeIdentifier(envelope *protocol.Envelope) string

EnvelopeIdentifier returns a human-readable identifier for the event to be used in log messages. Format: "<description> [<event-id>]".

func HandleHTTPResponse

func HandleHTTPResponse(response *http.Response, identifier string) bool

HandleHTTPResponse is a helper method that reads the HTTP response and handles debug output.

Types

type SendResult added in v0.44.0

type SendResult struct {
	Success    bool
	StatusCode int
	Limits     ratelimit.Map
}

SendResult holds the outcome of an HTTP request sent to Sentry.

func DoSendRequest added in v0.44.0

func DoSendRequest(client *http.Client, request *http.Request, identifier string) (*SendResult, error)

DoSendRequest executes an HTTP request, handles response logging, extracts rate limits, and drains+closes the response body.

func (*SendResult) IsSendError added in v0.44.0

func (r *SendResult) IsSendError() bool

IsSendError returns true if the response indicates a server/client error that should be recorded as send_error for client report outcomes (non-429 failures).

type SyncMap

type SyncMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

func (*SyncMap[K, V]) Clear

func (s *SyncMap[K, V]) Clear()

func (*SyncMap[K, V]) CompareAndDelete

func (s *SyncMap[K, V]) CompareAndDelete(key K, value V)

func (*SyncMap[K, V]) Delete

func (s *SyncMap[K, V]) Delete(key K)

func (*SyncMap[K, V]) Load

func (s *SyncMap[K, V]) Load(key K) (V, bool)

func (*SyncMap[K, V]) LoadOrStore

func (s *SyncMap[K, V]) LoadOrStore(key K, value V) (V, bool)

func (*SyncMap[K, V]) Range

func (s *SyncMap[K, V]) Range(f func(key K, value V) bool)

func (*SyncMap[K, V]) Store

func (s *SyncMap[K, V]) Store(key K, value V)

Jump to

Keyboard shortcuts

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