3 // Copyright 2022 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
11 type Response interface {
15 type HandlerFunc[Input any] func(Input) Response
17 func Operation[Input any](method, path string, h HandlerFunc[Input]) {
22 func Get[Body any](path string, h HandlerFunc[struct{ Body Body }]) {
23 Operation("GET", path, h)
27 Get("/", func(req struct{ Body None }) Response {