Documentation ¶
Index ¶
- Variables
- func CanAccess(user *model.User, meta *model.Meta, reqPath string, password string) bool
- func CanWrite(meta *model.Meta, path string) bool
- func ErrorResp(c *gin.Context, err error, code int, l ...bool)
- func ErrorStrResp(c *gin.Context, str string, code int, l ...bool)
- func ErrorWithDataResp(c *gin.Context, err error, code int, data interface{}, l ...bool)
- func GenerateToken(username string) (tokenString string, err error)
- func GetApiUrl(r *http.Request) string
- func HttpClient() *http.Client
- func IsApply(metaPath, reqPath string, applySub bool) bool
- func IsStorageSignEnabled(rawPath string) bool
- func Proxy(w http.ResponseWriter, r *http.Request, link *model.Link, file model.Obj) error
- func ShouldProxy(storage driver.Driver, filename string) bool
- func Sign(obj model.Obj, parent string, encrypt bool) string
- func SuccessResp(c *gin.Context, data ...interface{})
- type PageResp
- type Resp
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var SecretKey []byte
Functions ¶
func ErrorWithDataResp ¶ added in v3.5.1
func GenerateToken ¶
func HttpClient ¶
func IsStorageSignEnabled ¶ added in v3.15.0
func ShouldProxy ¶ added in v3.14.0
ShouldProxy TODO need optimize when should be proxy? 1. config.MustProxy() 2. storage.WebProxy 3. proxy_types
func SuccessResp ¶
Types ¶
type PageResp ¶
type PageResp struct { Content interface{} `json:"content"` Total int64 `json:"total"` }
type UserClaims ¶
type UserClaims struct { Username string `json:"username"` jwt.RegisteredClaims }
func ParseToken ¶
func ParseToken(tokenString string) (*UserClaims, error)
Click to show internal directories.
Click to hide internal directories.