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(user *model.User) (tokenString string, err error)
- func GetApiUrl(r *http.Request) string
- 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 ProxyRange(link *model.Link, size int64)
- 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 NoProxyRange = &model.RangeReadCloser{}
View Source
var SecretKey []byte
Functions ¶
func ErrorWithDataResp ¶
func IsStorageSignEnabled ¶
func ProxyRange ¶
func ShouldProxy ¶
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"` PwdTS int64 `json:"pwd_ts"` jwt.RegisteredClaims }
func ParseToken ¶
func ParseToken(tokenString string) (*UserClaims, error)
Click to show internal directories.
Click to hide internal directories.