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 ¶
- func Disable(ctx context.Context) context.Context
- func FromContext(ctx context.Context) (expectation.Expectation, bool)
- func IsDisabled(ctx context.Context) bool
- func IsInvalidExecution(err error) bool
- func NewContext(ctx context.Context, val expectation.Expectation) context.Context
- func NewContextFromContexts(ctx context.Context, ctxs []context.Context) (context.Context, error)
- func Restore(ctx context.Context) context.Context
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 FromContext ¶
func FromContext(ctx context.Context) (expectation.Expectation, bool)
FromContext returns the context value stored in ctx, if any.
func IsDisabled ¶
IsDisabled checks whether the given context has the context value removed and backed up.
func IsInvalidExecution ¶
IsInvalidExecution asserts invalidExecutionError.
func NewContext ¶
func NewContext(ctx context.Context, val expectation.Expectation) context.Context
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 ¶
This section is empty.