trace

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceHTTP    = "http"
	SourceSMTP    = "smtp"
	SourceMailman = "mailman"
	SourceCron    = "cron"
	SourceApp     = "app"
)
View Source
const (
	LevelInfo  models.TraceLevel = "info"
	LevelError models.TraceLevel = "error"
)
View Source
const (
	ActionEnvelopeCreated = "envelope.created"
)
View Source
const KeyAddress = "address"
View Source
const KeyAttachment = "attachment"
View Source
const KeyDuration = "duration"
View Source
const KeyEndpoint = "endpoint"
View Source
const KeyEnvelope = "envelope"
View Source
const KeyError = "error"
View Source
const KeyRule = "rule"

Variables

This section is empty.

Functions

This section is empty.

Types

type LogStore

type LogStore struct{}

func (LogStore) Save

func (LogStore) Save(ctx context.Context, trace models.Trace) error

type Option

type Option func(t *models.Trace)

func WithAddress

func WithAddress(address string) Option

func WithAttachment

func WithAttachment(id int64) Option

func WithDuration

func WithDuration(d time.Duration) Option

func WithEndpoint

func WithEndpoint(id int64) Option

func WithEnvelope

func WithEnvelope(id int64) Option

func WithError

func WithError(err error) Option

func WithKV

func WithKV(key string, value any) Option

func WithRule

func WithRule(id int64) Option

type Store

type Store interface {
	Save(ctx context.Context, trace models.Trace) error
}

type Tracer

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

func NewTracer

func NewTracer(store Store, source string) Tracer

func (Tracer) Sticky

func (t Tracer) Sticky(opts ...Option) Tracer

func (Tracer) Trace

func (t Tracer) Trace(ctx context.Context, action string, options ...Option)

Jump to

Keyboard shortcuts

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