Documentation ¶
Overview ¶
Package shared provides space to share variables.
Index ¶
- func VarToContext(ctx context.Context, key string, value interface{}) context.Context
- func VarsFromContext(ctx context.Context) map[string]interface{}
- type Vars
- func (v *Vars) Fork(ctx context.Context) (context.Context, *Vars)
- func (v *Vars) Get(s string) (interface{}, bool)
- func (v *Vars) GetAll() map[string]interface{}
- func (v *Vars) IsVar(s string) bool
- func (v *Vars) OnSet(f func(key string, val interface{}))
- func (v *Vars) Reset()
- func (v *Vars) Set(key string, val interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VarToContext ¶ added in v0.1.5
VarToContext adds variable to context.
func VarsFromContext ¶ added in v0.1.5
VarsFromContext returns variables from context.
Types ¶
type Vars ¶
type Vars struct { // VarPrefix determines which cell values should be collected as vars and replaced with values in usages. // Default is '$', e.g. $id1 would be treated as variable. VarPrefix string // contains filtered or unexported fields }
Vars keeps values of named variables.
func (*Vars) Fork ¶ added in v0.1.4
Fork instruments context with a copy of Vars or returns Vars that are already in context.
Click to show internal directories.
Click to hide internal directories.