Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenable ¶
Authenable is authentication manager.
type Cachable ¶
type Cachable interface { Get(id string) interface{} Set(id string, value interface{}, ttl time.Duration) Del(id string) Push(id string, value interface{}) Pop(id string) interface{} Flush() GC() }
Cachable represents Cachable specification.
type Context ¶
type Context interface { Request() Request Response() Response Auth() Authenable URL(string, map[string]string) string Cache() Cachable Session() Session }
Context represents incoming connection.
type Mango ¶
type Mango interface { Any(string, Callable, ...ThenableFunc) Get(string, Callable, ...ThenableFunc) Post(string, Callable, ...ThenableFunc) Put(string, Callable, ...ThenableFunc) Delete(string, Callable, ...ThenableFunc) Group(string, func(Router), ...ThenableFunc) Use(ThenableFunc) SetDefaultRoute(Callable) SetCachable(Cachable) Start(string) StartTLS(string, string, string) StartAutoTLS(string, autocert.Cache, ...string) ServeHTTP(http.ResponseWriter, *http.Request) On(event string, fn func()) }
Mango interface of mango micro framework.
type Request ¶
type Request interface { Parent() *http.Request IP() string File(string) (UploadedFile, error) Form(string) string Query(string) string Arg(string) string Input(string) string JSON(interface{}) error IsTLS() bool Header() http.Header Method() string URI() string URL() *url.URL Host() string SetArgs(map[string]string) Args() map[string]string }
Request represents incoming data from client.
type Response ¶
type Response interface { Parent() http.ResponseWriter Write([]byte) (int, error) WriteString(string) (int, error) WriteJSON(interface{}) error Header() http.Header Clear() Size() int Status() int SetStatus(int) SetCookie(*http.Cookie) DelCookie(string) Redirect(int, string) (int, interface{}) Buffered() []byte Send() error }
Response is interface of data will be sent to client.
type Route ¶
type Route interface { Method() string Path() string SetPath(string) Pathable() *regexp.Regexp Callable() Callable ThenStack() []ThenableFunc IsStatic() bool }
Route is part of Router.
type Router ¶
type Router interface { Any(string, Callable, ...ThenableFunc) Get(string, Callable, ...ThenableFunc) Post(string, Callable, ...ThenableFunc) Put(string, Callable, ...ThenableFunc) Delete(string, Callable, ...ThenableFunc) Group(string, func(Router), ...ThenableFunc) Use(...ThenableFunc) Prefixes() []string ThenableStack() []ThenableFunc SetThenableStack(...ThenableFunc) ToMatch(Request) (Route, map[string]string) SetDefaultRoute(Callable) }
Router interface.
type ThenableContext ¶
type ThenableContext interface { Context Next() }
ThenableContext is a context for thenable fucntion.
type ThenableFunc ¶
type ThenableFunc func(ThenableContext)
ThenableFunc uses as a thenable function as a middleware.
Click to show internal directories.
Click to hide internal directories.