Documentation ¶
Index ¶
- Constants
- Variables
- func RoleRight(m *ice.Message, userrole string, keys ...string) bool
- func SessCheck(m *ice.Message, sessid string) *ice.Message
- func SessCreate(m *ice.Message, username, userrole string) string
- func UserLogin(m *ice.Message, username, password string) bool
- func UserNick(m *ice.Message, username interface{}) (nick string)
- func UserRole(m *ice.Message, username interface{}) (role string)
- func UserRoot(m *ice.Message)
- func UserZone(m *ice.Message, username interface{}) (zone string)
Constants ¶
View Source
const ( USERNICK = "usernick" USERZONE = "userzone" USERNAME = "username" PASSWORD = "password" USERROLE = "userrole" USERNODE = "usernode" SESSID = "sessid" )
View Source
const ( ROOT = "root" TECH = "tech" VOID = "void" )
View Source
const ( White = "white" Black = "black" Right = "right" Prune = "prune" Clear = "clear" )
View Source
const (
ErrNotAuth = "not auth: "
)
View Source
const (
OK = "ok"
)
View Source
const ROLE = "role"
View Source
const SESS = "sess"
View Source
const USER = "user"
Variables ¶
View Source
var Index = &ice.Context{Name: "aaa", Help: "认证模块", Commands: map[string]*ice.Command{ ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Rich(ROLE, nil, kit.Dict(kit.MDB_NAME, VOID, White, kit.Dict(), Black, kit.Dict())) m.Rich(ROLE, nil, kit.Dict(kit.MDB_NAME, TECH, Black, kit.Dict(), White, kit.Dict())) m.Load() m.Cmd("mdb.search", "create", "user", "user", "aaa") }}, ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(USER, SESS, ROLE) }}, }}
Functions ¶
func SessCreate ¶ added in v0.2.3
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.