user

package
v0.0.0-...-d482505 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationInfo

func AuthenticationInfo(user *user.Data) map[string]interface{}

用户注册&登陆 统一返回的信息格式(敏感信息)

func CheckSign

func CheckSign(token string, req *http.Request) error

校验签名

func CreateSign

func CreateSign(token string, expire int, params map[string]string) (string, string)

生成签名 @return sign @return expire

func NormalInfo

func NormalInfo(user *user.Data) map[string]interface{}

获取某用户信息 统一返回的信息格式(非敏感信息)

Types

type Controller

type Controller struct {
	as.Controller
	// contains filtered or unexported fields
}

func New

func New() *Controller

func (*Controller) Authentication

func (this *Controller) Authentication(req *http.Request, session sessions.Session) (int, []byte)

登陆(获取授权令牌) @router /users/authentication [get]

func (*Controller) AuthenticationCreate

func (this *Controller) AuthenticationCreate(req *http.Request) (int, []byte)

预注册(创建授权令牌) 并不会注册用户,只会发邮件 @router /users/authentication (captcha) [post]

func (*Controller) AuthenticationDelete

func (this *Controller) AuthenticationDelete(req *http.Request, session sessions.Session) (int, []byte)

删除登陆令牌(登出) 并不会删除用户表信息 @router /users/authentication [delete]

func (*Controller) CreateEmailAuthentication

func (this *Controller) CreateEmailAuthentication(req *http.Request, session sessions.Session) (int, []byte)

真正注册 验证邮箱令牌,并注册用户 @router /users/authentication/email [post]

func (*Controller) Current

func (this *Controller) Current(session sessions.Session) (int, []byte)

获得当前登录的用户(可以获取敏感信息) @router /users/current [get]

func (*Controller) Get

func (this *Controller) Get(param martini.Params) (int, []byte)

根据帐户名获取用户信息(不能获取敏感信息) @router /users/:account [get]

Jump to

Keyboard shortcuts

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