context

package
v1.1.0-beta.0...-abef9b1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	gcontext.Context
	// contains filtered or unexported fields
}

Context is used to in dm to record some context field like * go context * logger

func Background

func Background() *Context

Background return a nop context

func NewContext

func NewContext(ctx gcontext.Context, logger log.Logger) *Context

NewContext return a new Context

func (*Context) L

func (c *Context) L() log.Logger

L returns real logger

func (*Context) WithCancel

func (c *Context) WithCancel() (*Context, gcontext.CancelFunc)

WithCancel sets a cancel context.

func (*Context) WithContext

func (c *Context) WithContext(ctx gcontext.Context) *Context

WithContext set go context

func (*Context) WithLogger

func (c *Context) WithLogger(logger log.Logger) *Context

WithLogger set logger

Jump to

Keyboard shortcuts

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