context

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenContextWithTimeout

func GenContextWithTimeout(t time.Duration) (context.Context, context.CancelFunc)

func GenDefaultContext

func GenDefaultContext() (context.Context, context.CancelFunc)

func GenShutdownContext

func GenShutdownContext() (context.Context, context.CancelFunc)

func KillContextAfterTimeout

func KillContextAfterTimeout()

func KillContextsAfter

func KillContextsAfter(t time.Duration)

func MergeContext

func MergeContext(c1, c2 context.Context) (context.Context, context.CancelFunc)

MergeContext

func New

func New(opt Option)

func RootContext

func RootContext() context.Context

Types

type Option

type Option struct {
	Timeout         string `json:"timeout" yaml:"timeout" toml:"timeout"`
	ShutdownTimeout string `json:"shutdown_timeout" yaml:"shutdown_timeout" toml:"shutdown_timeout"`
}

Jump to

Keyboard shortcuts

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