Documentation
¶
Index ¶
- Variables
- func NewAsyncTransport(options TransportOptions) protocol.TelemetryTransport
- func NewSyncTransport(options TransportOptions) protocol.TelemetryTransport
- type AsyncTransport
- func (t *AsyncTransport) Close()
- func (t *AsyncTransport) Flush(timeout time.Duration) bool
- func (t *AsyncTransport) FlushWithContext(ctx context.Context) bool
- func (t *AsyncTransport) HasCapacity() bool
- func (t *AsyncTransport) IsRateLimited(category ratelimit.Category) bool
- func (t *AsyncTransport) SendEnvelope(envelope *protocol.Envelope) error
- type NoopTransport
- func (t *NoopTransport) Close()
- func (t *NoopTransport) Flush(_ time.Duration) bool
- func (t *NoopTransport) FlushWithContext(_ context.Context) bool
- func (t *NoopTransport) HasCapacity() bool
- func (t *NoopTransport) IsRateLimited(_ ratelimit.Category) bool
- func (t *NoopTransport) SendEnvelope(_ *protocol.Envelope) error
- type SyncTransport
- func (t *SyncTransport) Close()
- func (t *SyncTransport) Flush(_ time.Duration) bool
- func (t *SyncTransport) FlushWithContext(_ context.Context) bool
- func (t *SyncTransport) HasCapacity() bool
- func (t *SyncTransport) IsRateLimited(category ratelimit.Category) bool
- func (t *SyncTransport) SendEnvelope(envelope *protocol.Envelope) error
- func (t *SyncTransport) SendEnvelopeWithContext(ctx context.Context, envelope *protocol.Envelope) error
- type TransportOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewAsyncTransport ¶
func NewAsyncTransport(options TransportOptions) protocol.TelemetryTransport
func NewSyncTransport ¶
func NewSyncTransport(options TransportOptions) protocol.TelemetryTransport
Types ¶
type AsyncTransport ¶
type AsyncTransport struct {
QueueSize int
Timeout time.Duration
// contains filtered or unexported fields
}
AsyncTransport is the default, non-blocking, implementation of Transport.
Clients using this transport will enqueue requests in a queue and return to the caller before any network communication has happened. Requests are sent to Sentry sequentially from a background goroutine.
func (*AsyncTransport) Close ¶
func (t *AsyncTransport) Close()
func (*AsyncTransport) FlushWithContext ¶
func (t *AsyncTransport) FlushWithContext(ctx context.Context) bool
func (*AsyncTransport) HasCapacity ¶ added in v0.38.0
func (t *AsyncTransport) HasCapacity() bool
HasCapacity reports whether the async transport queue appears to have space for at least one more envelope. This is a best-effort, non-blocking check.
func (*AsyncTransport) IsRateLimited ¶
func (t *AsyncTransport) IsRateLimited(category ratelimit.Category) bool
func (*AsyncTransport) SendEnvelope ¶
func (t *AsyncTransport) SendEnvelope(envelope *protocol.Envelope) error
type NoopTransport ¶
type NoopTransport struct{}
NoopTransport is a transport implementation that drops all events. Used internally when an empty or invalid DSN is provided.
func NewNoopTransport ¶
func NewNoopTransport() *NoopTransport
func (*NoopTransport) Close ¶
func (t *NoopTransport) Close()
func (*NoopTransport) FlushWithContext ¶
func (t *NoopTransport) FlushWithContext(_ context.Context) bool
func (*NoopTransport) HasCapacity ¶ added in v0.38.0
func (t *NoopTransport) HasCapacity() bool
func (*NoopTransport) IsRateLimited ¶
func (t *NoopTransport) IsRateLimited(_ ratelimit.Category) bool
func (*NoopTransport) SendEnvelope ¶
func (t *NoopTransport) SendEnvelope(_ *protocol.Envelope) error
type SyncTransport ¶
SyncTransport is a blocking implementation of Transport.
Clients using this transport will send requests to Sentry sequentially and block until a response is returned.
The blocking behavior is useful in a limited set of use cases. For example, use it when deploying code to a Function as a Service ("Serverless") platform, where any work happening in a background goroutine is not guaranteed to execute.
For most cases, prefer AsyncTransport.
func (*SyncTransport) Close ¶
func (t *SyncTransport) Close()
func (*SyncTransport) FlushWithContext ¶
func (t *SyncTransport) FlushWithContext(_ context.Context) bool
func (*SyncTransport) HasCapacity ¶ added in v0.38.0
func (t *SyncTransport) HasCapacity() bool
func (*SyncTransport) IsRateLimited ¶
func (t *SyncTransport) IsRateLimited(category ratelimit.Category) bool
func (*SyncTransport) SendEnvelope ¶
func (t *SyncTransport) SendEnvelope(envelope *protocol.Envelope) error