http

package
v0.0.0-...-134a4a7 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: BSD-3-Clause Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// LayoutTpl .
	LayoutTpl = "common/layout.html"
	// AdminLayoutTpl .
	AdminLayoutTpl = "common.html"
)
View Source
const (
	// TokenSalt .
	TokenSalt = "b3%JFOykZx_golang_polaris"
	// NeedReLoginCode .
	NeedReLoginCode = 600
)

Variables

View Source
var Store = sessions.NewCookieStore([]byte(config.ConfigFile.MustValue("global", "cookie_secret")))

Store .

Functions

func AccessControl

func AccessControl(ctx echo.Context)

AccessControl .

func CheckIsHttps

func CheckIsHttps(ctx echo.Context) bool

CheckIsHttps .

func GenToken

func GenToken(uid int) string

GenToken .

func GetCookieSession

func GetCookieSession(ctx echo.Context) *sessions.Session

GetCookieSession 必须是 http.Request

func GetFromCookie

func GetFromCookie(ctx echo.Context, key string) string

GetFromCookie .

func ParseToken

func ParseToken(token string) (int, bool)

ParseToken .

func Render

func Render(ctx echo.Context, contentTpl string, data map[string]interface{}) error

Render html 输出

func RenderAdmin

func RenderAdmin(ctx echo.Context, contentTpl string, data map[string]interface{}) error

RenderAdmin html 输出

func RenderQuery

func RenderQuery(ctx echo.Context, contentTpl string, data map[string]interface{}) error

RenderQuery 后台 query 查询返回结果

func Request

func Request(ctx echo.Context) *http.Request

Request .

func ResponseWriter

func ResponseWriter(ctx echo.Context) http.ResponseWriter

ResponseWriter .

func SetCookie

func SetCookie(ctx echo.Context, key, value string)

SetCookie .

func SetLoginCookie

func SetLoginCookie(ctx echo.Context, username string)

SetLoginCookie .

func ValidateToken

func ValidateToken(token string) bool

ValidateToken .

Types

This section is empty.

Directories

Path Synopsis
app
internal

Jump to

Keyboard shortcuts

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