Documentation ¶
Overview ¶
Implements a simple command oriented API Wrapper
Index ¶
- Constants
- Variables
- func AddDoc(d *Opts)
- func All[IN, OUT any](path string, f func(ctx context.Context, in IN) (OUT, error), o ...*Opts)
- func CtxCmd(c context.Context) string
- func CtxDone(c context.Context) func()
- func CtxMPF(c context.Context) *multipart.Form
- func CtxReadJson(c context.Context, in interface{}) error
- func CtxReq(c context.Context) *http.Request
- func CtxRes(c context.Context) http.ResponseWriter
- func CtxVar(c context.Context, v string) string
- func CtxVarInt(c context.Context, v string) int64
- func CtxVars(c context.Context) map[string]string
- func Delete[OUT any](path string, f func(ctx context.Context) (OUT, error), o ...*Opts)
- func DumpDoc(rw http.ResponseWriter, r *http.Request)
- func Get[OUT any](path string, f func(ctx context.Context) (OUT, error), o ...*Opts)
- func Head[OUT any](path string, f func(ctx context.Context) (OUT, error), o ...*Opts)
- func ListenDefault() error
- func ListenDefaultTLS(c string, k string) error
- func MW(h func(next http.Handler) http.Handler)
- func Mime(ext string) string
- func MimeF(f string) string
- func Mux() *gmux.Router
- func Post[IN, OUT any](path string, f func(ctx context.Context, in IN) (OUT, error), o ...*Opts)
- func Put[IN, OUT any](path string, f func(ctx context.Context, in IN) (OUT, error), o ...*Opts)
- func Raw(path string, f func(rw http.ResponseWriter, r *http.Request), o ...*Opts)
- func ReqCmd(r *http.Request) string
- func Setup() error
- func SetupWDeps(ds ...func() error) error
- func Static(webpath string, fsroot string)
- type NONE
- type Opts
Constants ¶
View Source
const PERM_ALL = "*"
View Source
const PERM_AUTH = "+"
Variables ¶
Functions ¶
func CtxReadJson ¶
func CtxRes ¶
func CtxRes(c context.Context) http.ResponseWriter
CtxRes - provides access to Response from context, suggar syntax.
func ListenDefault ¶
func ListenDefault() error
func ListenDefaultTLS ¶
func Setup ¶
func Setup() error
Setup - prepares nanoapi. For timebeing only registers __list command
func SetupWDeps ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.