Documentation ¶
Index ¶
- Variables
- func AfterTestMain(uuid, logOutUrl string, testClient *httptest.Client)
- func InitConfig() error
- func InitWeb()
- func IsExist() bool
- func Remove() error
- func StaticUrl() string
- type Captcha
- type CustomAspect
- type Limit
- type Route
- type System
- type Web
- type WebServer
- func (ws *WebServer) AddStatic(requestPath, root string)
- func (ws *WebServer) AddUploadStatic()
- func (ws *WebServer) AddWebStatic()
- func (ws *WebServer) GetRouterGroup(relativePath string) *gin.RouterGroup
- func (ws *WebServer) GetSources() ([]map[string]string, []map[string]string)
- func (ws *WebServer) GetTestClient(t *testing.T) *httptest.Client
- func (ws *WebServer) GetTestLogin(t *testing.T, url string, res httptest.Responses, datas ...interface{}) *httptest.Client
- func (ws *WebServer) InitDriver() error
- func (ws *WebServer) InitRouter() error
- func (ws *WebServer) Run()
Constants ¶
This section is empty.
Variables ¶
View Source
var CONFIG = Web{ MaxSize: 1024, Except: Route{ Uri: "", Method: "", }, System: System{ Tls: false, Level: "debug", Addr: "127.0.0.1:8085", StaticPrefix: "/upload", StaticPath: "/static/upload", WebPrefix: "/admin", WebPath: "./dist", DbType: "mysql", CacheType: "redis", TimeFormat: "2006-01-02 15:04:05", }, Limit: Limit{ Disable: true, Limit: 0, Burst: 5, }, Captcha: Captcha{ KeyLong: 4, ImgWidth: 240, ImgHeight: 80, }, }
View Source
var ErrAuthDriverEmpty = errors.New("认证驱动初始化失败")
Functions ¶
func AfterTestMain ¶
Types ¶
type CustomAspect ¶
type CustomAspect struct {
CustomValue int
}
func (*CustomAspect) GetStats ¶
func (a *CustomAspect) GetStats() interface{}
func (*CustomAspect) InRoot ¶
func (a *CustomAspect) InRoot() bool
func (*CustomAspect) Name ¶
func (a *CustomAspect) Name() string
type System ¶
type System struct { Tls bool `mapstructure:"tls" json:"tls" yaml:"tls"` Level string `mapstructure:"level" json:"level" yaml:"level"` // debug,release,test Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` StaticPrefix string `mapstructure:"static-prefix" json:"staticPrefix" yaml:"static-prefix"` StaticPath string `mapstructure:"static-path" json:"staticPath" yaml:"static-path"` WebPrefix string `mapstructure:"web-prefix" json:"webPPrefix" yaml:"web-prefix"` WebPath string `mapstructure:"web-path" json:"webPath" yaml:"web-path"` DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"` CacheType string `mapstructure:"cache-type" json:"cacheType" yaml:"cache-type"` TimeFormat string `mapstructure:"time-format" json:"timeFormat" yaml:"time-format"` }
type Web ¶
type Web struct { MaxSize int64 `mapstructure:"max-size" json:"burst" yaml:"max-size"` Except Route `mapstructure:"except" json:"except" yaml:"except"` System System `mapstructure:"system" json:"system" yaml:"system"` Limit Limit `mapstructure:"limit" json:"limit" yaml:"limit"` Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` }
type WebServer ¶
type WebServer struct {
// contains filtered or unexported fields
}
WebServer web服务 - app gin.Engine - idleConnsClosed - addr 服务访问地址 - timeFormat 时间格式 - staticPrefix 静态文件访问地址前缀 - staticPath 静态文件地址 - webPath 前端文件地址
func BeforeTestMain ¶
func (*WebServer) AddUploadStatic ¶
func (ws *WebServer) AddUploadStatic()
AddUploadStatic 添加上传文件访问地址
func (*WebServer) GetRouterGroup ¶
func (ws *WebServer) GetRouterGroup(relativePath string) *gin.RouterGroup
func (*WebServer) GetSources ¶
GetSources 获取系统路由 - PermRoutes 权鉴路由 - NoPermRoutes 公共路由
func (*WebServer) GetTestClient ¶
GetTestClient 获取测试验证客户端
Source Files ¶
Click to show internal directories.
Click to hide internal directories.