trace

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, fn Func, since time.Time)

Do calls the trace function with context and time elapsed

func DumpContextStr

func DumpContextStr(ctx context.Context) string

func Err

func Err(ctx context.Context, fn Func, err error)

Err calls the trace function with an error

func WithCollection

func WithCollection(parent context.Context, op Op, database, collection string) (context.Context, *int64, *int64)

Return a new context which contains matched and modified placeholders

func WithOp

func WithOp(parent context.Context, op Op) context.Context

func WithTx

func WithTx(parent context.Context) context.Context

func WithUrl

func WithUrl(parent context.Context, op Op, url *url.URL) context.Context

Types

type Func

type Func func(context.Context, time.Duration, error)

type Op

type Op uint
const (
	OpNone Op = iota
	OpConnect
	OpDisconnect
	OpPing
	OpCommit
	OpRollback
	OpInsert
	OpInsertMany
	OpDelete
	OpDeleteMany
	OpFind
	OpFindMany
	OpUpdate
	OpUpdateMany
	OpUpsert
	OpUpsertMany
	OpFindUpdate
)

func (Op) String

func (o Op) String() string

Jump to

Keyboard shortcuts

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