httphi router refactor (#176)

* httphi: RouterConfig refactor to enable DefaultRouterConfig

* RequestHeader not case sensitive anymore

* httphi: use DefaultRouterConfig in examples

* httphi: remove gated stage complexity

Misusing Stage methods by calling them once header has been written is totally harmless as far as I can tell. We simplify the codebase on this occasion by removing the headerWritten check for all stage methods

* httphi: improve APIs

* httphi: remove status
This commit is contained in:
Pat Whittingslow
2026-08-03 19:33:43 -03:00
committed by GitHub
parent 4517010070
commit d05cd14018
15 changed files with 428 additions and 150 deletions
+6
View File
@@ -462,6 +462,12 @@ type pairKV struct {
value view // value start >0 means value is present.
}
// SizeKV is the heap cost of a single key/value field slot, as reserved by the
// numHeaderCapacity argument to [HeaderV1.Reset] and by [Form.Reset]. Callers
// budgeting a fixed memory pool up front, such as a Router sizing its
// exchanges, multiply it by the pair capacity to account the field table.
const SizeKV = int(unsafe.Sizeof(pairKV{}))
// isValid is for stores parsed in place, where offset 0 is the first key so
// only length can signal presence. Empty keys are valid: see valueless cookies.
func (pair pairKV) isValid() bool {