gls: Index | Files

package gls

import ""


Package Files

gls.go goid.go

func DeleteGls Uses

func DeleteGls(goid int64)

DeleteGls remove goroutine local storage for specified goroutine

func Get Uses

func Get(key interface{}) interface{}

Get key from goroutine local storage

func GetGls Uses

func GetGls(goid int64) map[interface{}]interface{}

GetGls get goroutine local storage for specified goroutine if the goroutine did not set gls, it will return nil

func GoID Uses

func GoID() int64

GoID returns the goroutine id of current goroutine

func IsGlsEnabled Uses

func IsGlsEnabled(goid int64) bool

IsGlsEnabled test if the gls is available for specified goroutine

func ResetGls Uses

func ResetGls(goid int64, initialValue map[interface{}]interface{})

ResetGls reset the goroutine local storage for specified goroutine

func Set Uses

func Set(key interface{}, value interface{})

Set key and element to goroutine local storage

func WithEmptyGls Uses

func WithEmptyGls(f func()) func()

WithEmptyGls works like WithGls, but do not inherit gls from parent goroutine.

func WithGls Uses

func WithGls(f func()) func()

WithGls setup and teardown the gls in the wrapper. go WithGls(func(){}) will add gls for the new goroutine. The gls will be removed once goroutine exit

Package gls imports 3 packages (graph) and is imported by 2 packages. Updated 2019-06-30. Refresh now. Tools for package owners.