tree

package
v0.0.0-...-9678add Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2017 License: BSD-3-Clause Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disable

func Disable(ctx context.Context) context.Context

Disable removes the context value being stored using valueKey and backs it up using restoreKey.

func IsDisabled

func IsDisabled(ctx context.Context) bool

IsDisabled checks whether the given context has the context value removed and backed up.

func IsInvalidExecution

func IsInvalidExecution(err error) bool

IsInvalidExecution asserts invalidExecutionError.

func NewContext

func NewContext(ctx context.Context, val Value) context.Context

NewContext returns a new github.com/the-anna-project/context.Context that carries the context value val.

func NewContextFromContexts

func NewContextFromContexts(ctx context.Context, ctxs []context.Context) (context.Context, error)

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.

func Restore

func Restore(ctx context.Context) context.Context

Restore sets the context value using the value being backed up by a previous call to Disable.

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

func FromContext(ctx context.Context) (Value, bool)

FromContext returns the context value stored in ctx, if any.

func (Value) Equals

func (v Value) Equals(other Value) bool

Equals checks whether the properties of the current value equals the properties of the given value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL