web

package
v0.8.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2019 License: MIT Imports: 32 Imported by: 0

Documentation

Index

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

func AvatarHTML(s string) template.HTML

AvatarHTML 生成头像的HTML标签,目前仅支持微信头像

func DeleteTGC

func DeleteTGC(c *gin.Context)

func GetTGC

func GetTGC(c *gin.Context) *cas.Ticket

func IsAjax added in v0.6.3

func IsAjax(r *http.Request) bool

func New

func New(root, fs string) *server

New returns current server instance

func NewTGC

func NewTGC(c *gin.Context, ticket *cas.Ticket)

func SessionLoad added in v0.8.1

func SessionLoad(r *http.Request) session.Session

func SessionSave added in v0.8.1

func SessionSave(sess session.Session, w http.ResponseWriter)

func SetBase added in v0.6.10

func SetBase(s string)

func SetupSessionStore added in v0.8.1

func SetupSessionStore(store session.Store)

func UrlFor added in v0.6.10

func UrlFor(path string) string

func UserFromStaff

func UserFromStaff(staff *models.Staff) *auth.User

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 = auth.User

func UserWithContext added in v0.6.3

func UserWithContext(c *gin.Context) (user *User)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL