Documentation
¶
Overview ¶
Package tgrcontext provides the shared context key for tygor. This allows internal test utilities to create compatible contexts without importing the main tygor package (avoiding import cycles).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey = &struct{ name string }{"tygor"}
ContextKey is the key used to store tygor.Context in context.Context. This is exported so internal packages can create compatible contexts.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
context.Context
Service string
Name string
Request *http.Request
Writer http.ResponseWriter
}
Context mirrors tygor.Context for use in internal packages. The tygor package defines its own Context type with methods.
func NewContext ¶
func NewContext(parent context.Context, w http.ResponseWriter, r *http.Request, service, name string) *Context
NewContext creates a context with service metadata. The resulting context is compatible with tygor.FromContext.
Click to show internal directories.
Click to hide internal directories.