feat: add api context type

This commit is contained in:
Adrien Marquès 2021-04-18 18:14:30 +02:00
parent 08b825b38f
commit f334d19ef4
1 changed files with 17 additions and 0 deletions

17
api/context.go Normal file
View File

@ -0,0 +1,17 @@
package api
import (
"net/http"
)
// Ctx contains additional information for handlers
//
// usually input/output arguments built by aicra are sufficient
// but the Ctx lets you manage your request from scratch if required
//
// If required, set api.Ctx as the first argument of your handler; if you
// don't need it, only use standard input arguments and it will be ignored
type Ctx struct {
w http.ResponseWriter
r *http.Request
}