auth

package
v0.0.0-...-2912f65 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2014 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CookieStore *sessions.CookieStore

Functions

func AddCookie

func AddCookie(req *http.Request, resp http.ResponseWriter, id string)

func AddVisitorCookie

func AddVisitorCookie(req *http.Request, resp http.ResponseWriter) int64

func AuthEmployeeFilter

func AuthEmployeeFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

func AuthFilter

func AuthFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)

func AuthHandler

func AuthHandler(r *http.Request, w http.ResponseWriter) (bool, string)

func AuthVisitorHandler

func AuthVisitorHandler(r *http.Request, w http.ResponseWriter) (bool, string)

func Check

func Check(id string, n string, magic string) bool

func Decode

func Decode(c string) string

func DelCookie

func DelCookie(req *restful.Request, resp *restful.Response, id string)

func DelVisitorCookie

func DelVisitorCookie(req *restful.Request, resp *restful.Response, id string)

func Encode

func Encode(p string) string

func GenMagic

func GenMagic(id string, n string) string

func SetSysMagicNumber

func SetSysMagicNumber(m []byte)

Types

type User

type User struct {
	Id, Name, Pass, Email string
	Type                  int64
	Phone, CoverPhoto     string
}

func CurrCookieUser

func CurrCookieUser(req *restful.Request, resp *restful.Response) *User

func DbFindUser

func DbFindUser(id string) *User

Jump to

Keyboard shortcuts

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