tgrcontext

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

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