Documentation ¶
Index ¶
- Constants
- func ClearCookie(w http.ResponseWriter, cookieName string)
- func ErrHandled(err error, c *gin.Context) bool
- func FilterAssetNames(assetNames []string, suffix string) []string
- func FilterAssetNamesOrdered(assetNames []string, suffix string, orderedNames ...string) []string
- func MergeCSS(mustAsset func(name string) []byte, statics []string) string
- func MergeJs(mustAsset func(name string) []byte, statics []string) string
- func MergeResCSS(mustAsset func(name string) []byte, statics ...string) string
- func MergeResJs(mustAsset func(name string) []byte, statics ...string) string
- func MinifyCSS(cssString string, devMode bool) string
- func MinifyHTML(htmlString string, devMode bool) string
- func MinifyJs(jsString string, devMode bool) string
- func MustAuth(fn http.HandlerFunc, param MustAuthParam, cookieContextKey interface{}) http.HandlerFunc
- func OpenExplorer(port string)
- func OpenExplorerWithContext(contextPath, port string)
- func PprofAddrPflag() *string
- func PrepareMustAuthFlag(param *MustAuthParam)
- func ReadCookie(r *http.Request, encryptKey, cookieName string, cookieValue CookieValue) error
- func ServeFavicon(path string, mustAsset func(name string) []byte, ...) http.HandlerFunc
- func StartPprof(pprofAddr string)
- func WriteCookie(w http.ResponseWriter, encryptKey, cookieName string, cookieValue CookieValue) error
- func WriteDomainCookie(w http.ResponseWriter, domain, encryptKey, cookieName string, ...) error
- type CookieValue
- type CookieValueImpl
- type MustAuthParam
- type RspBase
- type RspBaseData
Constants ¶
View Source
const ContentTypeJSON = "application/json; charset=utf-8"
ContentTypeJSON ...
View Source
const ContentTypeText = "text/plain; charset=utf-8"
ContentTypeText ...
Variables ¶
This section is empty.
Functions ¶
func FilterAssetNames ¶
FilterAssetNames ...
func FilterAssetNamesOrdered ¶
FilterAssetNamesOrdered 合并指定后缀名 suffix 的资源,并且通过 orderedNames 指定的顺序先合并,然后再合并 assetNames 中其它的资源。 注意:orderedNames 中不要再包含后缀名
func MergeResCSS ¶
MergeResCSS ...
func MergeResJs ¶
MergeResJs ...
func MustAuth ¶
func MustAuth(fn http.HandlerFunc, param MustAuthParam, cookieContextKey interface{}) http.HandlerFunc
MustAuth ...
func OpenExplorerWithContext ¶
func OpenExplorerWithContext(contextPath, port string)
OpenExplorerWithContext ...
func ReadCookie ¶
func ReadCookie(r *http.Request, encryptKey, cookieName string, cookieValue CookieValue) error
ReadCookie ...
func ServeFavicon ¶
func ServeFavicon(path string, mustAsset func(name string) []byte, assetInfo func(name string) (os.FileInfo, error)) http.HandlerFunc
ServeFavicon ...
func WriteCookie ¶
func WriteCookie(w http.ResponseWriter, encryptKey, cookieName string, cookieValue CookieValue) error
WriteCookie ...
func WriteDomainCookie ¶
func WriteDomainCookie(w http.ResponseWriter, domain, encryptKey, cookieName string, cookieValue CookieValue) error
WriteDomainCookie ...
Types ¶
type CookieValueImpl ¶
type CookieValueImpl struct { UserID string Name string Avatar string CsrfToken string Expired time.Time }
CookieValueImpl ...
func (*CookieValueImpl) ExpiredTime ¶
func (t *CookieValueImpl) ExpiredTime() time.Time
ExpiredTime ...
type MustAuthParam ¶
type MustAuthParam struct { EncryptKey string CookieName string RedirectURI string LocalURL string ForceLogin bool }
MustAuthParam ...
type RspBaseData ¶
type RspBaseData struct { Status int `json:"status"` Message string `json:"message"` Data interface{} `json:"data"` }
RspBaseData 代表返回的公共结构
Click to show internal directories.
Click to hide internal directories.