Documentation ¶
Index ¶
- Variables
- func InitConfig() error
- func InitWeb()
- func IsExist() bool
- func Remove() error
- func ToStaticUrl(uri string) string
- type Captcha
- type Limit
- type Party
- type Route
- type System
- type Web
- type WebServer
- func (ws *WebServer) AddModule(parties ...Party)
- func (ws *WebServer) AddStatic(requestPath string, fsOrDir interface{}, opts ...iris.DirOptions)
- func (ws *WebServer) AddUploadStatic()
- func (ws *WebServer) AddWebStatic()
- 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 ¶
Types ¶
type Party ¶
type Party struct { Perfix string PartyFunc func(index iris.Party) }
Party 功能模块 - perfix 模块路由路径 - partyFunc 模块
type System ¶
type System struct { Tls bool `mapstructure:"tls" json:"tls" yaml:"tls"` // debug,release,test 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:"webPrefix" 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 iris application - idleConnsClosed - addr 服务访问地址 - timeFormat 时间格式 - staticPrefix 静态文件访问地址前缀 - staticPath 静态文件地址 - webPath 前端文件地址
func (*WebServer) AddUploadStatic ¶
func (ws *WebServer) AddUploadStatic()
AddUploadStatic 添加上传文件访问地址
func (*WebServer) GetSources ¶
GetSources 获取系统路由 - PermRoutes 权鉴路由 - NoPermRoutes 公共路由
func (*WebServer) GetTestClient ¶
GetTestClient 获取测试验证客户端
Click to show internal directories.
Click to hide internal directories.