context

package
v0.1.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 3 Imported by: 18

Documentation

Overview

Package context wraps built-in type context.Context. It serves a place to store/retrieve runtime data and expose utilitarian functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(fn api.ErrorFunc, err api.StreamError)

func GetErrFunc

func GetErrFunc(ctx context.Context) api.ErrorFunc

GetErrFunc returns the error handling function stored in the context.

func GetLogFunc

func GetLogFunc(ctx context.Context) func(interface{})

GetLogFunc returns the log function stored in the context.

func HandleErr

func HandleErr(ctx context.Context, err error) error

HandleErr used to invoke registered error handler to handle error.

func Log

func Log(ctx context.Context, message interface{}) error

Log retrieves Log Function from context and invokes it with message

func WithErrorFunc

func WithErrorFunc(ctx context.Context, errFunc api.ErrorFunc) context.Context

WithErrorFunc sets the function to handle error from runtime components

func WithLogFunc

func WithLogFunc(ctx context.Context, logFunc api.LogFunc) context.Context

WithLogFunc sets the function to handle logging from runtime components

Types

This section is empty.

Jump to

Keyboard shortcuts

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