Documentation
¶
Index ¶
- Constants
- Variables
- func AuthUserMiddleware(redirect bool) gin.HandlerFunc
- func AvatarHTML(s string) template.HTML
- func Default() *server
- func DeleteTGC(c *gin.Context)
- func GetTGC(c *gin.Context) *cas.Ticket
- func IsAjax(r *http.Request) bool
- 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
- 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 ¶
View Source
var (
CookieName = "_user"
)
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)
type User ¶
type User struct { Uid string `json:"uid"` Name string `json:"name"` Privileges string `json:"privileges"` LastHit int64 `json:"-"` // contains filtered or unexported fields }
func UserFromRequest ¶ added in v0.6.3
func UserFromStaff ¶
func UserWithContext ¶ added in v0.6.3
func (*User) DecodeMsgpack ¶ added in v0.6.3
func (*User) EncodeMsgpack ¶ added in v0.6.3
Source Files
¶
Click to show internal directories.
Click to hide internal directories.