login

package
v0.0.0-...-135b9b9 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*events.GlobalEvents
}

App 登录服务

func NewApp

func NewApp() *App

NewApp 创建新的登录服务器

func (*App) DoCreateNewUser

func (app *App) DoCreateNewUser(user, pwd string, grade uint32) (uint64, error)

DoCreateNewUser 创建新用户 根据用户名和密码创建新用户 创建成功后返回uid

func (*App) GetGatewayAddr

func (app *App) GetGatewayAddr() (string, error)

GetGatewayAddr 获取网关信息

func (*App) Start

func (app *App) Start()

Start 启动登录服务

func (*App) Stop

func (app *App) Stop()

Stop 停止登录服务

type RequireHostMiddleware

type RequireHostMiddleware struct{}

RequireHostMiddleware 只允许通过域名访问的请求

func (*RequireHostMiddleware) MiddlewareFunc

func (mw *RequireHostMiddleware) MiddlewareFunc(handler rest.HandlerFunc) rest.HandlerFunc

MiddlewareFunc 具体实现

type UserCreateAck

type UserCreateAck struct {
	UID       uint64
	Result    int
	ResultMsg string
}

UserCreateAck 创建帐号返回

type UserCreateReq

type UserCreateReq struct {
	User     string
	Password string
}

UserCreateReq 创建帐号消息

type UserLoginAck

type UserLoginAck struct {
	UID       uint64
	Token     string
	LobbyAddr string
	Result    int
	ResultMsg string
	HB        bool
}

UserLoginAck 登录消息返回格式

type UserLoginReq

type UserLoginReq struct {
	User      string
	Password  string
	Token     string
	Channel   string
	ClientVer string
	Data      []byte
}

UserLoginReq 登录消息格式

Jump to

Keyboard shortcuts

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