duckbugprovider

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 13 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeforeSendFunc

type BeforeSendFunc func(eventType core.EventType, payload map[string]any) (map[string]any, bool)

type Config

type Config struct {
	DSN                     string
	Transport               Transport
	BatchSize               int
	DisableAsync            bool
	QueueSize               int
	FlushInterval           time.Duration
	Privacy                 PrivacyOptions
	BeforeSend              BeforeSendFunc
	TransportFailureHandler func(core.FailureInfo)
	Timeout                 time.Duration
	ConnectionTimeout       time.Duration
	MaxRetries              int
	RetryDelay              time.Duration
}

type HTTPTransport

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

func NewHTTPTransport

func NewHTTPTransport(config HTTPTransportConfig) *HTTPTransport

func (*HTTPTransport) Send

func (t *HTTPTransport) Send(ctx context.Context, dsn string, eventType core.EventType, data map[string]any) core.TransportResult

func (*HTTPTransport) SendBatch

func (t *HTTPTransport) SendBatch(ctx context.Context, dsn string, eventType core.EventType, items []map[string]any) core.TransportResult

type HTTPTransportConfig

type HTTPTransportConfig struct {
	Client            *http.Client
	Timeout           time.Duration
	ConnectionTimeout time.Duration
	MaxRetries        int
	RetryDelay        time.Duration
	MaxResponseBytes  int64
}

type Option

type Option func(*Config)

func WithAsync added in v0.1.1

func WithAsync(enabled bool) Option

func WithBatchSize

func WithBatchSize(size int) Option

func WithBeforeSend

func WithBeforeSend(fn BeforeSendFunc) Option

func WithConnectionTimeout

func WithConnectionTimeout(timeout time.Duration) Option

func WithFlushInterval added in v0.1.1

func WithFlushInterval(interval time.Duration) Option

func WithMaxRetries

func WithMaxRetries(maxRetries int) Option

func WithPrivacy

func WithPrivacy(options PrivacyOptions) Option

func WithQueueSize added in v0.1.1

func WithQueueSize(size int) Option

func WithRetryDelay

func WithRetryDelay(delay time.Duration) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

func WithTransport

func WithTransport(transport Transport) Option

func WithTransportFailureHandler

func WithTransportFailureHandler(fn func(core.FailureInfo)) Option

type PrivacyOptions

type PrivacyOptions struct {
	CaptureRequestContext bool
	CaptureHeaders        bool
	CaptureBody           bool
	CaptureSession        bool
	CaptureCookies        bool
	CaptureFiles          bool
	CaptureEnv            bool
}

func DefaultPrivacyOptions

func DefaultPrivacyOptions() PrivacyOptions

type Provider

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

func New

func New(dsn string, options ...Option) *Provider

func NewWithConfig

func NewWithConfig(config Config) *Provider

func (*Provider) CaptureEvent

func (p *Provider) CaptureEvent(ctx context.Context, event core.Event)

func (*Provider) Flush

func (p *Provider) Flush(ctx context.Context)

type Transport

type Transport interface {
	Send(ctx context.Context, dsn string, eventType core.EventType, data map[string]any) core.TransportResult
	SendBatch(ctx context.Context, dsn string, eventType core.EventType, items []map[string]any) core.TransportResult
}

Jump to

Keyboard shortcuts

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