context

package
v1.8.9 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsolateParent

func IsolateParent(parent context.Context) context.Context

Types

type Config

type Config interface {
	context.Context

	Merge(cfg Config) bool

	Store(key string, cfg interface{})
	Load(key string) interface{}
}

func NewConfig

func NewConfig(ctx context.Context) Config

type FuncLogger added in v1.7.0

type FuncLogger func() liblog.Logger

type GinTonic

type GinTonic interface {
	context.Context

	//generic
	GinContext() *gin.Context
	CancelOnSignal(s ...os.Signal)

	//gin context metadata
	Set(key string, value interface{})
	Get(key string) (value interface{}, exists bool)
	MustGet(key string) interface{}
	GetString(key string) (s string)
	GetBool(key string) (b bool)
	GetInt(key string) (i int)
	GetInt64(key string) (i64 int64)
	GetFloat64(key string) (f64 float64)
	GetTime(key string) (t time.Time)
	GetDuration(key string) (d time.Duration)
	GetStringSlice(key string) (ss []string)
	GetStringMap(key string) (sm map[string]interface{})
	GetStringMapString(key string) (sms map[string]string)
	GetStringMapStringSlice(key string) (smss map[string][]string)

	SetLogger(log FuncLogger)
}

func NewGinTonic

func NewGinTonic(c *gin.Context) GinTonic

Jump to

Keyboard shortcuts

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