Documentation
¶
Overview ¶
Package gls implements goroutine-local storage.
Index ¶
- func Clear()
- func Copy(src map[string]interface{})
- func Get(key string) interface{}
- func GetOK(key string) (value interface{}, ok bool)
- func GoroutineID() uint64
- func Keys() []string
- func RawMap() map[string]interface{}
- func Remove(key string)
- func Set(key string, value interface{})
- func Values() []interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clear ¶
func Clear()
Clear removes all gls associated with this goroutine. If this is not called, the gls may persist for the lifetime of your application. This must be called from the very first goroutine to invoke Set
func Copy ¶
func Copy(src map[string]interface{})
Copy sets multiple values and associates it with the current goroutine.
func Get ¶
func Get(key string) interface{}
Get gets the value by key as it exists for the current goroutine.
func GoroutineID ¶
func GoroutineID() uint64
GoroutineID returns a goroutine ID Reference: http://blog.sgmansfield.com/2015/12/goroutine-ids/
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.