context

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 4 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[T comparable] interface {
	context.Context
	MapManage[T]
	Context

	Clone(ctx context.Context) Config[T]
	Merge(cfg Config[T]) bool
	Walk(fct FuncWalk[T]) bool
	WalkLimit(fct FuncWalk[T], validKeys ...T) bool

	LoadOrStore(key T, cfg interface{}) (val interface{}, loaded bool)
	LoadAndDelete(key T) (val interface{}, loaded bool)
}

func NewConfig

func NewConfig[T comparable](ctx FuncContext) Config[T]

type Context added in v1.10.0

type Context interface {
	GetContext() context.Context
}

type FuncContext added in v1.10.0

type FuncContext func() context.Context

type FuncContextConfig added in v1.10.0

type FuncContextConfig[T comparable] func() Config[T]

type FuncWalk added in v1.10.0

type FuncWalk[T comparable] func(key T, val interface{}) bool

type MapManage added in v1.10.0

type MapManage[T comparable] interface {
	Clean()
	Load(key T) (val interface{}, ok bool)
	Store(key T, cfg interface{})
	Delete(key T)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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