expectation

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: 5 Imported by: 0

Documentation

Overview

Package expectation 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 FromContext

func FromContext(ctx context.Context) (expectation.Expectation, bool)

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

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

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

This section is empty.

Jump to

Keyboard shortcuts

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