Versions in this module Expand all Collapse all v0 v0.4.5 Sep 7, 2024 v0.4.3 Sep 7, 2024 v0.4.2 Sep 6, 2024 Changes in this version + func Init() v0.4.1 Sep 6, 2024 v0.4.0 Sep 6, 2024 Changes in this version type Context + Exception exception.Exception + Output *TO + func (r *Context[TI, TO]) Return(data ...*TO) *Res[TO] + func (r *Context[TI, TO]) Throw(err exception.Exception) *Res[TO] type Router + func (r *Router[TI, TO]) Register(app *Nichirin, httpMethod HttpMethod, url string, ...) *Router[TI, TO] v0.3.0 Aug 1, 2024 v0.2.3 Aug 1, 2024 v0.2.2 Jul 28, 2024 v0.2.1 Jul 28, 2024 v0.2.0 Jul 27, 2024 Changes in this version + func SendResponse[T any](w http.ResponseWriter, v *Res[T]) + func ThrowBadRequest(w http.ResponseWriter, err error) + type Context struct + Input *T + Logger *logger.Logger + Request *http.Request + Timeline ContextTimeline + TraceId string + func NewContext[T any](req *http.Request) *Context[T] + type ContextTimeline struct + Finished int64 + Started int64 + type HttpMethod string + const Delete + const Get + const Head + const Options + const Patch + const Post + const Put + type Nichirin struct + Address string + Engine *chi.Mux + func NewApp(addr string) *Nichirin + func (s *Nichirin) StartServer() + type Res struct + Data *T + Err exception.Exception + func CreateResponse[T any](data *T, err exception.Exception) *Res[T] + type ResPayload struct + Code string + Data *T + Message string + type Router struct + AuthGuard bool + Handler func(*Context[TI]) *Res[TO] + Method HttpMethod + Name string + Url string + func (r *Router[T, I]) Attach(app *Nichirin) *Router[T, I] + func (r *Router[T, I]) Auth() *Router[T, I] + func (r *Router[T, I]) Path(url string) *Router[T, I] + func (r *Router[TI, TO]) Handle(fn func(*Context[TI]) *Res[TO]) *Router[TI, TO]