Documentation ¶
Index ¶
- Constants
- Variables
- func Init() error
- func InitWeb() error
- func IsExist() bool
- func Remove() error
- func Start(wf WebFunc)
- func StartTest(wf WebFunc)
- func ToStaticUrl(uri string) string
- func Verfiy()
- type Captcha
- type Limit
- type Route
- type System
- type Web
- type WebBaseFunc
- type WebFunc
- type WebTestFunc
Constants ¶
View Source
const ( AdminAuthorityId uint = 1 // 管理员用户 TenancyAuthorityId uint = 2 // 商户用户 LiteAuthorityId uint = 3 // 小程序用户 DeviceAuthorityId uint = 4 // 床旁设备用户 )
Variables ¶
View Source
var CONFIG = Web{ MaxSize: 1024, Except: Route{ Uri: "", Method: "", }, System: System{ Tls: false, Level: "release", Addr: "127.0.0.1:8085", DbType: "mysql", TimeFormat: "2006-01-02 15:04:05", }, Limit: Limit{ Disable: true, Limit: 0, Burst: 5, }, Captcha: Captcha{ KeyLong: 4, ImgWidth: 240, ImgHeight: 80, }, }
Functions ¶
Types ¶
type System ¶ added in v1.1.2
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"` WebPrefix string `mapstructure:"web-prefix" json:"webPrefix" yaml:"web-prefix"` DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"` TimeFormat string `mapstructure:"time-format" json:"timeFormat" yaml:"time-format"` }
type Web ¶ added in v1.1.2
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 WebBaseFunc ¶ added in v1.1.2
type WebFunc ¶
type WebFunc interface { WebBaseFunc WebTestFunc }
WebFunc 框架服务接口 - GetTestClient 测试客户端 - GetTestLogin 测试登录 - AddWebStatic 添加静态页面 - AddUploadStatic 上传文件路径 - Run 启动
Click to show internal directories.
Click to hide internal directories.