Versions in this module Expand all Collapse all v0 v0.0.1 Dec 20, 2022 Changes in this version + const HubContextKey + const RequestContextKey + const SDKIdentifier + const SDKVersion + const Version + var Logger = log.New(io.Discard, "[Sentry] ", log.LstdFlags) + func AddBreadcrumb(breadcrumb *Breadcrumb) + func AddGlobalEventProcessor(processor EventProcessor) + func ConfigureScope(f func(scope *Scope)) + func Flush(timeout time.Duration) bool + func HasHubOnContext(ctx context.Context) bool + func Init(options ClientOptions) error + func PopScope() + func PushScope() + func SetHubOnContext(ctx context.Context, hub *Hub) context.Context + func WithScope(f func(scope *Scope)) + type Breadcrumb struct + Category string + Data map[string]interface{} + Level Level + Message string + Timestamp time.Time + Type string + func (b *Breadcrumb) MarshalJSON() ([]byte, error) + type BreadcrumbHint map[string]interface + type Client struct + Transport Transport + func NewClient(options ClientOptions) (*Client, error) + func (client *Client) AddEventProcessor(processor EventProcessor) + func (client *Client) CaptureEvent(event *Event, hint *EventHint, scope EventModifier) *EventID + func (client *Client) CaptureException(exception error, hint *EventHint, scope EventModifier) *EventID + func (client *Client) CaptureMessage(message string, hint *EventHint, scope EventModifier) *EventID + func (client *Client) EventFromException(exception error, level Level) *Event + func (client *Client) Flush(timeout time.Duration) bool + func (client *Client) Recover(err interface{}, hint *EventHint, scope EventModifier) *EventID + func (client *Client) RecoverWithContext(ctx context.Context, err interface{}, hint *EventHint, scope EventModifier) *EventID + func (client Client) Options() ClientOptions + type ClientOptions struct + AttachStacktrace bool + BeforeBreadcrumb func(breadcrumb *Breadcrumb, hint *BreadcrumbHint) *Breadcrumb + BeforeSend func(event *Event, hint *EventHint) *Event + CaCerts *x509.CertPool + Debug bool + DebugWriter io.Writer + Dist string + Dsn string + EnableTracing bool + Environment string + HTTPClient *http.Client + HTTPProxy string + HTTPSProxy string + HTTPTransport http.RoundTripper + IgnoreErrors []string + Integrations func([]Integration) []Integration + MaxBreadcrumbs int + MaxErrorDepth int + MaxSpans int + Release string + SampleRate float64 + SendDefaultPII bool + ServerName string + TracesSampleRate float64 + TracesSampler TracesSampler + Transport Transport + type Context = map[string]interface + type Dsn struct + func NewDsn(rawURL string) (*Dsn, error) + func (dsn *Dsn) UnmarshalJSON(data []byte) error + func (dsn Dsn) EnvelopeAPIURL() *url.URL + func (dsn Dsn) MarshalJSON() ([]byte, error) + func (dsn Dsn) RequestHeaders() map[string]string + func (dsn Dsn) StoreAPIURL() *url.URL + func (dsn Dsn) String() string + type DsnParseError struct + Message string + func (e DsnParseError) Error() string + type DynamicSamplingContext struct + Entries map[string]string + Frozen bool + func DynamicSamplingContextFromHeader(header []byte) (DynamicSamplingContext, error) + func DynamicSamplingContextFromTransaction(span *Span) DynamicSamplingContext + func (d DynamicSamplingContext) HasEntries() bool + func (d DynamicSamplingContext) IsFrozen() bool + func (d DynamicSamplingContext) String() string + type Event struct + Breadcrumbs []*Breadcrumb + Contexts map[string]Context + Dist string + Environment string + EventID EventID + Exception []Exception + Extra map[string]interface{} + Fingerprint []string + Level Level + Logger string + Message string + Modules map[string]string + Platform string + Release string + Request *Request + Sdk SdkInfo + ServerName string + Spans []*Span + StartTime time.Time + Tags map[string]string + Threads []Thread + Timestamp time.Time + Transaction string + TransactionInfo *TransactionInfo + Type string + User User + func NewEvent() *Event + func (e *Event) MarshalJSON() ([]byte, error) + type EventHint struct + Context context.Context + Data interface{} + EventID string + OriginalException error + RecoveredException interface{} + Request *http.Request + Response *http.Response + type EventID string + func CaptureEvent(event *Event) *EventID + func CaptureException(exception error) *EventID + func CaptureMessage(message string) *EventID + func LastEventID() EventID + func Recover() *EventID + func RecoverWithContext(ctx context.Context) *EventID + type EventModifier interface + ApplyToEvent func(event *Event, hint *EventHint) *Event + type EventProcessor func(event *Event, hint *EventHint) *Event + type Exception struct + Module string + Stacktrace *Stacktrace + ThreadID string + Type string + Value string + type Frame struct + AbsPath string + Colno int + ContextLine string + Filename string + Function string + InApp bool + Lineno int + Module string + Package string + PostContext []string + PreContext []string + Symbol string + Vars map[string]interface{} + func NewFrame(f runtime.Frame) Frame + type HTTPSyncTransport struct + Timeout time.Duration + func NewHTTPSyncTransport() *HTTPSyncTransport + func (t *HTTPSyncTransport) Configure(options ClientOptions) + func (t *HTTPSyncTransport) Flush(_ time.Duration) bool + func (t *HTTPSyncTransport) SendEvent(event *Event) + type HTTPTransport struct + BufferSize int + Timeout time.Duration + func NewHTTPTransport() *HTTPTransport + func (t *HTTPTransport) Configure(options ClientOptions) + func (t *HTTPTransport) Flush(timeout time.Duration) bool + func (t *HTTPTransport) SendEvent(event *Event) + type Hub struct + func CurrentHub() *Hub + func GetHubFromContext(ctx context.Context) *Hub + func NewHub(client *Client, scope *Scope) *Hub + func (hub *Hub) AddBreadcrumb(breadcrumb *Breadcrumb, hint *BreadcrumbHint) + func (hub *Hub) BindClient(client *Client) + func (hub *Hub) CaptureEvent(event *Event) *EventID + func (hub *Hub) CaptureException(exception error) *EventID + func (hub *Hub) CaptureMessage(message string) *EventID + func (hub *Hub) Client() *Client + func (hub *Hub) Clone() *Hub + func (hub *Hub) ConfigureScope(f func(scope *Scope)) + func (hub *Hub) Flush(timeout time.Duration) bool + func (hub *Hub) LastEventID() EventID + func (hub *Hub) PopScope() + func (hub *Hub) PushScope() *Scope + func (hub *Hub) Recover(err interface{}) *EventID + func (hub *Hub) RecoverWithContext(ctx context.Context, err interface{}) *EventID + func (hub *Hub) Scope() *Scope + func (hub *Hub) WithScope(f func(scope *Scope)) + type Integration interface + Name func() string + SetupOnce func(client *Client) + type Level string + const LevelDebug + const LevelError + const LevelFatal + const LevelInfo + const LevelWarning + type Request struct + Cookies string + Data string + Env map[string]string + Headers map[string]string + Method string + QueryString string + URL string + func NewRequest(r *http.Request) *Request + type SDKMetaData struct + type Sampled int8 + const SampledFalse + const SampledTrue + const SampledUndefined + func (s Sampled) Bool() bool + func (s Sampled) String() string + type SamplingContext struct + Parent *Span + Span *Span + type Scope struct + func NewScope() *Scope + func (scope *Scope) AddBreadcrumb(breadcrumb *Breadcrumb, limit int) + func (scope *Scope) AddEventProcessor(processor EventProcessor) + func (scope *Scope) ApplyToEvent(event *Event, hint *EventHint) *Event + func (scope *Scope) Clear() + func (scope *Scope) ClearBreadcrumbs() + func (scope *Scope) Clone() *Scope + func (scope *Scope) RemoveContext(key string) + func (scope *Scope) RemoveExtra(key string) + func (scope *Scope) RemoveTag(key string) + func (scope *Scope) SetContext(key string, value Context) + func (scope *Scope) SetContexts(contexts map[string]Context) + func (scope *Scope) SetExtra(key string, value interface{}) + func (scope *Scope) SetExtras(extra map[string]interface{}) + func (scope *Scope) SetFingerprint(fingerprint []string) + func (scope *Scope) SetLevel(level Level) + func (scope *Scope) SetRequest(r *http.Request) + func (scope *Scope) SetRequestBody(b []byte) + func (scope *Scope) SetTag(key, value string) + func (scope *Scope) SetTags(tags map[string]string) + func (scope *Scope) SetTransaction(name string) + func (scope *Scope) SetUser(user User) + func (scope *Scope) Transaction() (name string) + type SdkInfo struct + Integrations []string + Name string + Packages []SdkPackage + Version string + type SdkPackage struct + Name string + Version string + type Span struct + Data map[string]interface{} + Description string + EndTime time.Time + Op string + ParentSpanID SpanID + Sampled Sampled + Source TransactionSource + SpanID SpanID + StartTime time.Time + Status SpanStatus + Tags map[string]string + TraceID TraceID + func StartSpan(ctx context.Context, operation string, options ...SpanOption) *Span + func StartTransaction(ctx context.Context, name string, options ...SpanOption) *Span + func TransactionFromContext(ctx context.Context) *Span + func (s *Span) Context() context.Context + func (s *Span) Finish() + func (s *Span) MarshalJSON() ([]byte, error) + func (s *Span) SetTag(name, value string) + func (s *Span) StartChild(operation string, options ...SpanOption) *Span + func (s *Span) ToBaggage() string + func (s *Span) ToSentryTrace() string + type SpanID [8]byte + func (id SpanID) Hex() []byte + func (id SpanID) MarshalText() ([]byte, error) + func (id SpanID) String() string + type SpanOption func(s *Span) + func ContinueFromHeaders(trace, baggage string) SpanOption + func ContinueFromRequest(r *http.Request) SpanOption + func ContinueFromTrace(trace string) SpanOption + func OpName(name string) SpanOption + func TransactionName(name string) SpanOption + func TransctionSource(source TransactionSource) SpanOption + type SpanStatus uint8 + const SpanStatusAborted + const SpanStatusAlreadyExists + const SpanStatusCanceled + const SpanStatusDataLoss + const SpanStatusDeadlineExceeded + const SpanStatusFailedPrecondition + const SpanStatusInternalError + const SpanStatusInvalidArgument + const SpanStatusNotFound + const SpanStatusOK + const SpanStatusOutOfRange + const SpanStatusPermissionDenied + const SpanStatusResourceExhausted + const SpanStatusUnauthenticated + const SpanStatusUnavailable + const SpanStatusUndefined + const SpanStatusUnimplemented + const SpanStatusUnknown + func (ss SpanStatus) MarshalJSON() ([]byte, error) + func (ss SpanStatus) String() string + type Stacktrace struct + Frames []Frame + FramesOmitted []uint + func ExtractStacktrace(err error) *Stacktrace + func NewStacktrace() *Stacktrace + type Thread struct + Crashed bool + Current bool + ID string + Name string + Stacktrace *Stacktrace + type TraceContext struct + Description string + Op string + ParentSpanID SpanID + SpanID SpanID + Status SpanStatus + TraceID TraceID + func (tc *TraceContext) MarshalJSON() ([]byte, error) + func (tc TraceContext) Map() map[string]interface{} + type TraceID [16]byte + func (id TraceID) Hex() []byte + func (id TraceID) MarshalText() ([]byte, error) + func (id TraceID) String() string + type TracesSampler func(ctx SamplingContext) float64 + func (f TracesSampler) Sample(ctx SamplingContext) float64 + type TransactionInfo struct + Source TransactionSource + type TransactionSource string + const SourceComponent + const SourceCustom + const SourceRoute + const SourceTask + const SourceURL + const SourceView + type Transport interface + Configure func(options ClientOptions) + Flush func(timeout time.Duration) bool + SendEvent func(event *Event) + type User struct + Data map[string]string + Email string + ID string + IPAddress string + Name string + Segment string + Username string + func (u User) IsEmpty() bool