Documentation ¶
Index ¶
- func DbQuery(query string, args ...interface{}) []map[string]interface{}
- func GetDb() (*gorm.DB, error)
- func GetDbAuto() *gorm.DB
- func GetDbAutoMigrate(values ...interface{}) *gorm.DB
- func GetGormAuto() *gorm.DB
- func GetWebSocket(group string, hand interfaces.WebSocketInterface) *melody.Melody
- func GetXormAuto() *xorm.Engine
- func SetConfig(c *Config)
- func SetConfigFile(c string)
- type Config
- type ConfigDb
- type ConfigRedis
- type Controller
- type Request
- type Response
- func (r *Response) CheckErrDisplayByError(err error, msg ...string)
- func (r *Response) ClearSession()
- func (r *Response) DeleteSession(name string)
- func (r *Response) Display(data interface{}, msg string, code int)
- func (r *Response) DisplayByData(data interface{})
- func (r *Response) DisplayByError(msg string, code int, data ...string)
- func (r *Response) DisplayByRaw(data []byte)
- func (r *Response) DisplayByString(data string)
- func (r *Response) DisplayBySuccess(msg string)
- func (r *Response) SetCookie(name string, value string)
- func (r *Response) SetHeader(name string, value string)
- func (r *Response) SetSession(name string, value string)
- type ResponseData
- type RouterManage
- func (rm *RouterManage) GetControllerName(name string) string
- func (rm *RouterManage) GetFunName(name string) string
- func (rm *RouterManage) GetModuleName(name string) string
- func (rm *RouterManage) Registered(i interface{})
- func (rm *RouterManage) RouterSend(urlPath string, request Request, response Response, crossDomain string)
- type WebSocket
- type Xorm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDbAutoMigrate ¶
func GetGormAuto ¶
func GetWebSocket ¶
func GetWebSocket(group string, hand interfaces.WebSocketInterface) *melody.Melody
func GetXormAuto ¶
func SetConfigFile ¶
func SetConfigFile(c string)
Types ¶
type Config ¶
type Config struct { Port string `json:"port"` Host string `json:"host"` CrossDomain string `json:"cross_domain"` ApiRouter string `json:"api_router"` StaticRouter string `json:"static_router"` IsStaticStripPrefix bool `json:"is_static_strip_prefix"` StaticFileSystem http.FileSystem `json:"static_file_system"` PostMaxMemory int64 `json:"post_max_memory"` Db ConfigDb `json:"db"` Redis ConfigRedis `json:"redis"` UpdateDir string `json:"update_dir"` UpdatePath string `json:"update_path"` }
func GetInstanceConfig ¶
func GetInstanceConfig() *Config
func (*Config) ReadConfig ¶
func (*Config) ReadPrivateConfig ¶
type ConfigRedis ¶
type Controller ¶
func (*Controller) ControllerInit ¶
func (c *Controller) ControllerInit(req Request, res Response)
func (*Controller) RequestToStruct ¶
func (c *Controller) RequestToStruct(v interface{}) error
type Request ¶
type Request struct { GET map[string]string POST map[string]string REQUEST map[string]string COOKIE map[string]string SESSION map[string]string HEADER map[string]string BODY string FILES map[string][]*multipart.FileHeader FILE *multipart.FileHeader OriginRequest *http.Request OriginValues url.Values }
func (*Request) SyncCookieData ¶
func (*Request) SyncGetData ¶
func (*Request) SyncHeaderData ¶
func (*Request) SyncSessionData ¶
type Response ¶
type Response struct { Session *session.Session IsWebSocket bool OriginResponseWriter http.ResponseWriter }
func (*Response) CheckErrDisplayByError ¶
func (*Response) ClearSession ¶
func (r *Response) ClearSession()
func (*Response) DeleteSession ¶
func (*Response) DisplayByData ¶
func (r *Response) DisplayByData(data interface{})
func (*Response) DisplayByError ¶
func (*Response) DisplayByRaw ¶
func (*Response) DisplayByString ¶
func (*Response) DisplayBySuccess ¶
func (*Response) SetSession ¶
type ResponseData ¶
type RouterManage ¶
func GetInstanceRouterManage ¶
func GetInstanceRouterManage() *RouterManage
func (*RouterManage) GetControllerName ¶
func (rm *RouterManage) GetControllerName(name string) string
func (*RouterManage) GetFunName ¶
func (rm *RouterManage) GetFunName(name string) string
func (*RouterManage) GetModuleName ¶
func (rm *RouterManage) GetModuleName(name string) string
func (*RouterManage) Registered ¶
func (rm *RouterManage) Registered(i interface{})
func (*RouterManage) RouterSend ¶
func (rm *RouterManage) RouterSend(urlPath string, request Request, response Response, crossDomain string)
type WebSocket ¶
type WebSocket struct { FunName string // contains filtered or unexported fields }
func (*WebSocket) GetWebSocket ¶
func (that *WebSocket) GetWebSocket() *melody.Melody
func (*WebSocket) SetFunName ¶
func (*WebSocket) WebSocketInit ¶
func (that *WebSocket) WebSocketInit(wsx *melody.Melody)
Click to show internal directories.
Click to hide internal directories.