context

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {

	//rpc metadata
	*metadata.Metadata

	//Trace exists throughout the life cycle of the context
	//trace is request flow trace
	//it's will be from web client,or generated on initialize
	Trace trace.Trace

	//Content-Type
	ContentType string

	//set http header
	Header map[string]string

	//setting http data context
	Data map[string]interface{}
}

func Background

func Background() *Context

func FromMetadata

func FromMetadata(b []byte) *Context

func NewContext added in v1.0.1

func NewContext(service, method, tracing string, meta map[string]string) (*Context, error)

func (*Context) Codec added in v1.0.9

func (c *Context) Codec() codec.Codec

func (*Context) Debug

func (c *Context) Debug(msg ...interface{})

func (*Context) Debugf

func (c *Context) Debugf(f string, msg ...interface{})

func (*Context) Error

func (c *Context) Error(msg ...interface{})

func (*Context) Errorf

func (c *Context) Errorf(f string, msg ...interface{})

func (*Context) Get added in v1.0.7

func (c *Context) Get(key string) interface{}

func (*Context) GetHeader added in v1.0.7

func (c *Context) GetHeader(key string) string

func (*Context) Info

func (c *Context) Info(msg ...interface{})

func (*Context) Infof

func (c *Context) Infof(f string, msg ...interface{})

func (*Context) Set added in v1.0.7

func (c *Context) Set(key string, value interface{})

func (*Context) SetHeader added in v1.0.7

func (c *Context) SetHeader(key, value string)

func (*Context) WithMetadata

func (c *Context) WithMetadata(service, method string, meta map[string]string) error

Jump to

Keyboard shortcuts

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