context

package
v1.1.31 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: Apache-2.0 Imports: 11 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

	IsPutFile bool

	RemoteAddr string
	// contains filtered or unexported fields
}

func Background

func Background() *Context

func FromMetadata

func FromMetadata(b []byte, metadataType string) (*Context, error)

func (*Context) ClientIP added in v1.1.24

func (c *Context) ClientIP() string

func (*Context) Clone added in v1.1.18

func (c *Context) Clone(service, method 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) GetSetupData added in v1.1.17

func (c *Context) GetSetupData() []byte

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) SetCodec added in v1.1.29

func (c *Context) SetCodec()

func (*Context) SetHeader added in v1.0.7

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

func (*Context) SetSetupData added in v1.1.17

func (c *Context) SetSetupData(value []byte)

Jump to

Keyboard shortcuts

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