context

package
v2.285.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 2 Imported by: 13

Documentation

Overview

Package context provides small wrappers and aliases around the standard library context package.

This package exposes commonly used context helpers and types so callers can depend on go-service primitives while still using standard library semantics.

Index

Constants

This section is empty.

Variables

View Source
var Canceled = context.Canceled

Canceled is an alias for context.Canceled.

Functions

func WithDeadline

func WithDeadline(parent Context, d time.Time) (Context, CancelFunc)

WithDeadline is an alias for context.WithDeadline.

func WithTimeout

func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)

WithTimeout is an alias for context.WithTimeout.

Types

type CancelFunc

type CancelFunc = context.CancelFunc

CancelFunc is an alias for context.CancelFunc.

type Context

type Context = context.Context

Context is an alias for context.Context.

func Background

func Background() Context

Background is an alias for context.Background.

func WithValue

func WithValue(parent Context, key, val any) Context

WithValue is an alias for context.WithValue.

type Key

type Key string

Key is used as a typed key for storing values in a context.

This helps avoid key collisions when using context values.

Jump to

Keyboard shortcuts

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