perf

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogContextKeyStr = Key("key")
View Source
var UnnamedKeyStr = "unamed_key"

Functions

This section is empty.

Types

type ArrayContext

type ArrayContext struct {
	BaseContext
}

func (*ArrayContext) Add

func (c *ArrayContext) Add(key string, value any)

func (*ArrayContext) Get

func (c *ArrayContext) Get() any

type BaseContext

type BaseContext struct {
	ContextInterface
	Ctx   context.Context
	Mutex sync.RWMutex
}

func (*BaseContext) GetMutex

func (c *BaseContext) GetMutex() *sync.RWMutex

type ContextInterface

type ContextInterface interface {
	Add(key string, value any)
	Get() any
	GetMutex() *sync.RWMutex
}

type Key

type Key string

type MutexMapContext

type MutexMapContext struct {
	BaseContext
}

func (*MutexMapContext) Add

func (c *MutexMapContext) Add(key string, value any)

func (*MutexMapContext) Get

func (c *MutexMapContext) Get() any

type SyncMapContext

type SyncMapContext struct {
	BaseContext
}

func (*SyncMapContext) Add

func (c *SyncMapContext) Add(key string, value any)

func (*SyncMapContext) Get

func (c *SyncMapContext) Get() any

The log of SyncMap doesn't output as expected, duo to zap doesn't support sync.Map directly.

Jump to

Keyboard shortcuts

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