Documentation
¶
Index ¶
- Constants
- func LoggerFromContext(c context.Context) log.Logger
- func MtoHeader(m M) http.Header
- func ServiceNameFromContext(c context.Context) string
- func WithLogger(c context.Context, log log.Logger) context.Context
- func WithServiceName(c context.Context, name string) context.Context
- type C
- type Context
- func (c *Context) Abort(v interface{})
- func (c *Context) AbortWithError(v interface{}, err error)
- func (c *Context) Ack(args ...interface{})
- func (c *Context) Bind(v interface{}) error
- func (c *Context) Deadline() (time.Time, bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) Get(key interface{}) interface{}
- func (c *Context) JSON(v interface{})
- func (c *Context) Log() log.Logger
- func (c *Context) Nack(args ...interface{})
- func (c *Context) Next()
- func (c *Context) Proto(pb proto.Message)
- func (c *Context) RunHandlers(handlers ...Handler)
- func (c *Context) Set(key interface{}, value interface{})
- func (c *Context) SetLogger(entry log.Logger)
- func (c *Context) String(text string)
- func (c *Context) Value(key interface{}) interface{}
- type Handler
- type M
- type MockContext
- type R
Constants ¶
View Source
const ( TypeJson = "application/json" TypePlain = "text/plain" TypeProto = "application/protobuf" TypeXProto = "application/x-protobuf" )
Variables ¶
This section is empty.
Functions ¶
func ServiceNameFromContext ¶
Types ¶
type Context ¶
type Context struct {
C C
Error error
// Log log.Logger
TraceID string
SpanID string
ServiceName string
Request *R
Headers M
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) AbortWithError ¶
func (*Context) RunHandlers ¶
type M ¶
type M map[string]interface{}
func HTTPHeaderToM ¶
func (M) ForeachKey ¶
ForeachKey conforms to the TextMapReader interface.
type MockContext ¶
type MockContext struct {
Response *R
}
func (*MockContext) Ack ¶
func (m *MockContext) Ack(...interface{})
func (*MockContext) Nack ¶
func (m *MockContext) Nack(...interface{})
func (*MockContext) Publish ¶
func (m *MockContext) Publish(r *R)
func (*MockContext) Request ¶
func (m *MockContext) Request() *R
Click to show internal directories.
Click to hide internal directories.