From f334d19ef4dc919242586fe009bfb7bc256c6c89 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 18 Apr 2021 18:14:30 +0200 Subject: [PATCH] feat: add api context type --- api/context.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 api/context.go diff --git a/api/context.go b/api/context.go new file mode 100644 index 0000000..ba506d7 --- /dev/null +++ b/api/context.go @@ -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 +}