Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdapterManager ¶
type AdapterManager struct {
HttpAdapter BaseHTTPAdapter
SocketAdapter BaseSocketAdapter
}
func (*AdapterManager) EsureAdapter ¶
func (m *AdapterManager) EsureAdapter(adapterType string)
func (*AdapterManager) UseHttpAdapter ¶
func (m *AdapterManager) UseHttpAdapter(adapter BaseHTTPAdapter, app *App)
func (*AdapterManager) UseSocketAdapter ¶
func (m *AdapterManager) UseSocketAdapter(adapter BaseSocketAdapter, app *App)
type App ¶
type App struct {
Adapter *AdapterManager
HttpAdapter BaseHTTPAdapter
SocketAdapter BaseSocketAdapter
}
type BaseHTTPAdapter ¶
type BaseSocketAdapter ¶
type HttpController ¶
func InitHttpController ¶
func InitHttpController(app *App, module *Module) *HttpController
func (*HttpController) Route ¶
func (m *HttpController) Route(method string, path string, handler RouteHandler) *Route
type Request ¶
type Request interface {
GetHeader(name string) string
GetCookie(name string) (string, error)
GetIP() string
GetQuery(key string) string
GetParam(key string) string
GetFormValue(key string) string
GetBody() ([]byte, error)
Method() string
Path() string
Host() string
URL() string
ContentType() string
BindJSON(obj interface{}) error
BindForm(obj interface{}) error
BindQuery(obj interface{}) error
Context() any
FormFile(name string) (any, error)
}
type Response ¶
type Response interface {
SetHeader(name string, value string)
SetStatus(code int)
SetCookie(name string, value string, path string, maxAge int)
JSON(code int, obj interface{}) error
Text(code int, msg string) error
HTML(code int, html string) error
Blob(code int, contentType string, data []byte) error
Redirect(code int, url string) error
SendFile(filePath string) error
Writer() any
}
type RouteHandler ¶
type SocketEventHandler ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.