Documentation ¶
Index ¶
- Constants
- Variables
- func AuthUserMiddleware() gin.HandlerFunc
- func DeleteTGC(c *gin.Context)
- func GetTGC(c *gin.Context) *cas.Ticket
- func IsAjax(r *http.Request) bool
- func New() *server
- func NewTGC(c *gin.Context, ticket *cas.Ticket)
- func Render(c *gin.Context, name string, data interface{}) (err error)
- func T(name string) *template.Template
- type AccessTokenGenJWT
- type User
Constants ¶
View Source
const ( LimitArticle = 3 LimitLinks = 10 )
View Source
const (
LoginPath = "/login"
)
Variables ¶
View Source
var (
CookieName = "_user"
)
Functions ¶
func AuthUserMiddleware ¶ added in v0.6.3
func AuthUserMiddleware() gin.HandlerFunc
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"` 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.