ctxutil

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultQueryTimeout is the default timeout for database queries
	DefaultQueryTimeout = 5 * time.Second

	// LongQueryTimeout is for complex queries that may take longer
	LongQueryTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

func WithCustomTimeout

func WithCustomTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)

WithCustomTimeout adds a custom timeout duration

func WithLongQueryTimeout

func WithLongQueryTimeout(ctx context.Context) (context.Context, context.CancelFunc)

WithLongQueryTimeout adds a longer timeout for complex queries

func WithQueryTimeout

func WithQueryTimeout(ctx context.Context) (context.Context, context.CancelFunc)

WithQueryTimeout adds a timeout to the context for database queries Returns the new context and a cancel function that should be deferred

Types

This section is empty.

Jump to

Keyboard shortcuts

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