Documentation ¶
Index ¶
- Constants
- func AuthUserMiddleware(redirect bool) gin.HandlerFunc
- func AvatarHTML(s string) template.HTML
- func DeleteTGC(c *gin.Context)
- func GetTGC(c *gin.Context) *cas.Ticket
- func IsAjax(r *http.Request) bool
- func New(root, fs string) *server
- func NewTGC(c *gin.Context, ticket *cas.Ticket)
- func SessionLoad(r *http.Request) session.Session
- func SessionSave(sess session.Session, w http.ResponseWriter)
- func SetBase(s string)
- func SetupSessionStore(store session.Store)
- func UrlFor(path string) string
- func UserFromStaff(staff *models.Staff) *auth.User
- type AccessTokenGenJWT
- type User
Constants ¶
View Source
const ( LimitArticle = 3 LimitLinks = 10 )
View Source
const ( ERROR_DB = 1 ERROR_PARAM = 2 ERROR_INTERNAL = 3 ERROR_LIMIT = 4 )
Variables ¶
This section is empty.
Functions ¶
func AuthUserMiddleware ¶ added in v0.6.3
func AuthUserMiddleware(redirect bool) gin.HandlerFunc
func AvatarHTML ¶ added in v0.8.2
AvatarHTML 生成头像的HTML标签,目前仅支持微信头像
func SessionSave ¶ added in v0.8.1
func SessionSave(sess session.Session, w http.ResponseWriter)
func SetupSessionStore ¶ added in v0.8.1
Types ¶
type AccessTokenGenJWT ¶
type AccessTokenGenJWT struct {
Key []byte
}
JWT access token generator
func (*AccessTokenGenJWT) GenerateAccessToken ¶
func (c *AccessTokenGenJWT) GenerateAccessToken(data *osin.AccessData, generaterefresh bool) (accesstoken string, refreshtoken string, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.