Documentation ¶
Overview ¶
Package tree stores and accesses the values defined in this package in and from a github.com/the-anna-project/context.Context.
Index ¶
- func Disable(ctx context.Context) context.Context
- func IsDisabled(ctx context.Context) bool
- func IsInvalidExecution(err error) bool
- func NewContext(ctx context.Context, val Value) context.Context
- func NewContextFromContexts(ctx context.Context, ctxs []context.Context) (context.Context, error)
- func Restore(ctx context.Context) context.Context
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Disable ¶
Disable removes the context value being stored using valueKey and backs it up using restoreKey.
func IsDisabled ¶
IsDisabled checks whether the given context has the context value removed and backed up.
func IsInvalidExecution ¶
IsInvalidExecution asserts invalidExecutionError.
func NewContext ¶
NewContext returns a new github.com/the-anna-project/context.Context that carries the context value val.
func NewContextFromContexts ¶
NewContextFromContexts sets the context value from the given list of contexts to the given single context. Therefore all context values transported by all contexts of the given list of contexts have to be equal.
Types ¶
type Value ¶
type Value struct { // ID represents the ID of the current CLG tree. ID string `json:"id"` }
Value is the context value being managed by this package.
func FromContext ¶
FromContext returns the context value stored in ctx, if any.