Documentation ¶
Overview ¶
Simple http web server support apis and static files both. GoFrame used.
Index ¶
- func App(host string, port int, apiv string, apis *APIS, apig *APIG)
- func Download(url string, filepath string, descPrefix ...string) (int64, error)
- func Get(url string, timeout ...int) (string, error)
- func MiddlewareDefault(r *ghttp.Request)
- func Post(url string, data interface{}, contentType string, timeout ...int) (string, error)
- type APIG
- type APIS
- type DefaultHandlerResponse
- type Meta
- type MiddlewareFn
- type Request
- type Resource
- type ResourceHandle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func App ¶
Create a http server, with default routes[/(public),/api,/swagger], apis is a map of api interfaces,
Types ¶
type APIG ¶
type APIG map[string]ResourceHandle
type DefaultHandlerResponse ¶
type MiddlewareFn ¶
type MiddlewareFn func(r *Request)
Self-defined Middleware Intermediate processing of the interface
type ResourceHandle ¶
type ResourceHandle struct { MiddlewareCallback MiddlewareFn // Pointer of Resource struct Res Resource }
Click to show internal directories.
Click to hide internal directories.