Documentation ¶
Index ¶
- func Register(value models.Identifier)
- func ToAliasKeys(source map[string]interface{}) map[string]interface{}
- func TrimLength(v string, length int) string
- type AppleCrashReport
- type Breadcrumb
- type Breadcrumbs
- type CSP
- type Contexts
- type DebugMeta
- type Device
- type EventEntry
- type EventInterfaces
- type Exception
- type ExceptionValue
- type Frame
- type FrameContext
- type FrameContextLine
- type HTTP
- type LogEntry
- type Query
- type Repo
- type Repos
- type SDK
- type Stacktrace
- type Template
- type Threads
- type Upstream
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(value models.Identifier)
func ToAliasKeys ¶
TODO return error that contains all unexpected keys
func TrimLength ¶
TrimLength truncates string up to length characters. If given string is shorter than length if will be returned without any changes. TODO move to the strings package
Types ¶
type AppleCrashReport ¶
type AppleCrashReport struct { }
func (*AppleCrashReport) KeyAlias ¶
func (*AppleCrashReport) KeyAlias() string
func (*AppleCrashReport) KeyCanonical ¶
func (*AppleCrashReport) KeyCanonical() string
type Breadcrumb ¶
type Breadcrumb struct { Type string `in:"type" json:"type"` Timestamp time.Time `in:"timestamp" json:"timestamp"` Level interface{} `in:"level" json:"level,omitempty"` Message string `in:"message" json:"message,omitempty"` Category string `in:"category" json:"category,omitempty"` Data map[string]interface{} `in:"data" json:"data,omitempty"` EventID interface{} `in:"event_id" json:"event_id,omitempty"` }
type Breadcrumbs ¶
type Breadcrumbs struct {
Values []Breadcrumb `in:"values" json:"values"`
}
Breadcrumbs interface stores information that leads up to an error.
- “message“ must be no more than 1000 characters in length.
[{ "type": "message", // timestamp can be ISO format or a unix timestamp (as float) "timestamp": "2016-01-17T12:30:00", "data": { "message": "My raw message with interpreted strings like %s", }
], ...}
func (*Breadcrumbs) DecodeRequest ¶
func (breadcrumbs *Breadcrumbs) DecodeRequest(request map[string]interface{}) error
func (*Breadcrumbs) KeyAlias ¶
func (*Breadcrumbs) KeyAlias() string
func (*Breadcrumbs) KeyCanonical ¶
func (*Breadcrumbs) KeyCanonical() string
type EventEntry ¶
type EventEntry struct { Type string `kv:"-" in:"-" json:"type"` Value models.Identifier `kv:"-" in:"-" json:"data"` }
type EventInterfaces ¶
type EventInterfaces struct { // Built-in interfaces, sorted by name AppleCrashReport *AppleCrashReport `kv:"applecrashreport" in:"applecrashreport" json:"-"` Breadcrumbs *Breadcrumbs `kv:"breadcrumbs" in:"breadcrumbs" json:"-"` Contexts *Contexts `kv:"contexts" in:"contexts" json:"contexts,omitempty"` CSP *CSP `kv:"csp" in:"csp" json:"-"` DebugMeta *DebugMeta `kv:"debug_meta" in:"debug_meta" json:"-"` Device *Device `kv:"devce" in:"devce" json:"device,omitempty"` Exception *Exception `kv:"exception" in:"exception" json:"-"` LogEntry *LogEntry `kv:"logentry" in:"logentry" json:"-"` Query *Query `kv:"query" in:"query" json:"-"` Repos *Repos `kv:"repos" in:"repos" json:"-"` Request *HTTP `kv:"request" in:"request" json:"-"` SDK *SDK `kv:"sdk" in:"sdk" json:"sdk,omitempty"` Stacktrace *Stacktrace `kv:"stacktrace" in:"stacktrace" json:"-"` Template *Template `kv:"template" in:"template" json:"-"` Threads *Threads `kv:"threads" in:"threads" json:"-"` User *User `kv:"user" in:"user" json:"user"` // TODO omitempty? Message string `in:"-" json:"message"` Entries []EventEntry `in:"-" json:"entries"` // TODO omitempty? }
func (*EventInterfaces) DecodeRecord ¶
func (event *EventInterfaces) DecodeRecord(record map[string]interface{}) error
func (*EventInterfaces) DecodeRequest ¶
func (event *EventInterfaces) DecodeRequest(request map[string]interface{}) error
type Exception ¶
type Exception struct { Values []ExceptionValue `in:"values" json:"values"` HasSystemFrames bool `in:"-" json:"hasSystemFrames"` ExcOmitted bool `in:"-" json:"excOmitted"` }
Exception consists of a list of values. In most cases, this list contains a single exception, with an optional stacktrace interface.
Each exception has a mandatory `value` argument and optional `type` and `module` arguments describing the exception class type and module namespace.
You can also optionally bind a stacktrace interface to an exception. The spec is identical to `sentry.interfaces.Stacktrace`.
{ "values": [{ "type": "ValueError", "value": "My exception value", "module": "__builtins__", "mechanism": {}, "stacktrace": { // see sentry.interfaces.Stacktrace } }] }
Values should be sent oldest to newest, this includes both the stacktrace and the exception itself.
func (*Exception) DecodeRequest ¶
func (*Exception) KeyCanonical ¶
type ExceptionValue ¶
type ExceptionValue struct { Type string `in:"type" json:"type"` Value string `in:"value" json:"value"` Module string `in:"module" json:"module"` Mechanism interface{} `in:"mechanism" json:"mechanism"` Stacktrace Stacktrace `in:"stacktrace" json:"stacktrace"` HasSystemFrames bool `in:"-" json:"hasSystemFrames"` // TODO ? SlimFrames bool `in:"-" json:"slimFrames"` // TODO ? }
type Frame ¶
type Frame struct { ColumnNumber *int `kv:"colno" in:"colno" json:"colNo"` LineNumber int `kv:"lineno" in:"lineno" json:"lineNo"` InstructionOffset *int `kv:"instruction_offset" in:"instruction_offset" json:"instructionOffset"` // TODO type? InstructionAddress *string `kv:"instruction_addr" in:"instruction_addr" json:"instructionAddr"` // TODO type? Symbol *string `kv:"symbol" in:"-" json:"symbol"` // TODO type? SymbolAddress *string `kv:"symbol_addr" in:"symbol_addr" json:"symbolAddr"` // TODO type? AbsolutePath string `kv:"abs_path" in:"abs_path" json:"absPath"` Module string `kv:"module" in:"module" json:"module"` Package *string `kv:"package" in:"package" json:"package"` Platform *string `kv:"platform" in:"platform" json:"platform"` // TODO type? Errors *string `kv:"errors" in:"-" json:"errors"` // TODO type? InApp bool `kv:"in_app" in:"in_app" json:"inApp"` Filename string `kv:"filename" in:"filename" json:"filename"` Function string `kv:"function" in:"function" json:"function"` Context FrameContext `kv:"-" in:"-" json:"context"` ContextLineNode string `kv:"context_line" in:"context_line" json:"-"` PreContextNode []string `kv:"pre_context" in:"pre_context" json:"-"` PostContextNode []string `kv:"post_context" in:"post_context" json:"-"` Variables map[string]interface{} `kv:"-" in:"vars" json:"vars"` VariablesNode map[interface{}]interface{} `kv:"vars" in:"-" json:"-"` }
TODO https://docs.sentry.io/clientdev/interfaces/stacktrace/ image_addr symbol?
type FrameContext ¶
type FrameContext []FrameContextLine
type FrameContextLine ¶
func (FrameContextLine) MarshalJSON ¶
func (contextLine FrameContextLine) MarshalJSON() ([]byte, error)
type HTTP ¶
func (*HTTP) KeyCanonical ¶
type LogEntry ¶
type LogEntry struct { Message string `kv:"message" in:"message" json:"message"` Formatted string `kv:"formatted" in:"formatted" json:"-"` Params []interface{} `kv:"params" in:"params" json:"-"` }
LogEntry is an interface consisted of a “message“ arg, an an optional “params“ arg for formatting, and an optional “formatted“ message which is the result of “message“ combined with “params“.
If your message cannot be parameterized, then the message interface will serve no benefit.
- “message“ must be no more than 1000 characters in length.
{ "message": "My raw message with interpreted strings like %s", "formatted": "My raw message with interpreted strings like this", "params": ["this"] }
func (*LogEntry) KeyCanonical ¶
type Repo ¶
type Repo struct { Name string `kv:"name" in:"name" json:"name"` Prefix string `kv:"prefix" in:"prefix" json:"prefix"` Revision *string `kv:"revision" in:"revision" json:"revision"` }
Repo contains details about one repository for the Repos interface.
type Repos ¶
Repos contains details about repositories connected to an event. This is primarily used to aid with mapping the application code's filepath to the equivilent path inside of a repository.
{ "/abs/path/to/sentry": { "name": "getsentry/sentry", "prefix": "src", "revision": "..." // optional } }
func (*Repos) KeyCanonical ¶
type SDK ¶
type SDK struct { Name string `kv:"name" in:"name" json:"name"` Version string `kv:"version" in:"version" json:"version"` ClientIP string `kv:"client_ip" in:"-" json:"clientIP"` Upstream Upstream `json:"upstream" in:"-"` }
The SDK used to transmit this event.
{ "name": "sentry-unity", "version": "1.0" }
func (*SDK) DecodeRecord ¶
func (*SDK) KeyCanonical ¶
type Stacktrace ¶
type Stacktrace struct { HasSystemFrames bool `kv:"has_system_frames" in:"-" json:"hasSystemFrames"` FramesOmitted *bool `kv:"frames_omitted" in:"-" json:"framesOmitted"` // TODO type? Frames []Frame `kv:"frames" in:"frames" json:"frames"` }
func (*Stacktrace) DecodeRecord ¶
func (stacktrace *Stacktrace) DecodeRecord(record map[string]interface{}) error
func (*Stacktrace) KeyAlias ¶
func (*Stacktrace) KeyAlias() string
func (*Stacktrace) KeyCanonical ¶
func (*Stacktrace) KeyCanonical() string
type User ¶
type User struct { ID string `in:"id" json:"id"` Username string `in:"username" json:"username"` Email string `in:"email" json:"email"` IPAddress string `in:"ip_address" json:"ip_address"` // TODO Does Sentry allows arbitrary key/value pairs for User interface? Extra map[string]string `in:"-" json:"-"` }
User is an interface which describes the authenticated User for a request.
You should provide **at least** either an `id` (a unique identifier for an authenticated user) or `ip_address` (their IP address).
All other attributes are optional.
{ "id": "unique_id", "username": "my_user", "email": "foo@example.com" "ip_address": "127.0.0.1", "optional": "value" }