Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UContext ¶
type UContext struct {
// contains filtered or unexported fields
}
UContext provides a concurrent-safe, app-global key-value store.
Use GetContext() to access the singleton instance from anywhere in your application. Values can be stored and retrieved using any comparable key type.
Example usage:
ctx := uctx.GetContext()
ctx.Set("config", myConfig)
cfg := ctx.Get("config").(*Config)
func GetContext ¶
func GetContext() *UContext
GetContext returns the singleton app-global context instance. This instance is safe for concurrent access and should be used throughout your application to store and retrieve global values.
func (*UContext) Get ¶
Get retrieves the value associated with the provided key. Returns nil if the key does not exist.