context

package
v1.0.1-0...-bd443ad Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AppCtxValuesKey = "AppCtxValuesKey"

Variables

This section is empty.

Functions

func EmptyAppCtx

func EmptyAppCtx() context.Context

func NewAppCtx

func NewAppCtx(parent context.Context, values ...*AppCtxValues) context.Context

Types

type AppCtxValues

type AppCtxValues struct {
	context_enum.ContextValues
	StartTime time.Time   //开始调用时间
	LastTime  time.Time   //调用结束时间
	Tx        interface{} // 数据库事务对象 可有可无 跟随ctx下发 线程不安全
}

func GetAppValues

func GetAppValues(ctx context.Context) *AppCtxValues

func MustGetAppValues

func MustGetAppValues(ctx context.Context) *AppCtxValues

func NewAppCtxValues

func NewAppCtxValues() *AppCtxValues

func (*AppCtxValues) Clone

func (a *AppCtxValues) Clone(tx interface{}) *AppCtxValues

func (*AppCtxValues) CopyFrom

func (a *AppCtxValues) CopyFrom(p *AppCtxValues)

Jump to

Keyboard shortcuts

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