aaa

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 RoleRight added in v0.2.3

func RoleRight(m *ice.Message, userrole string, keys ...string) bool

func SessCheck added in v0.2.3

func SessCheck(m *ice.Message, sessid string) *ice.Message

func SessCreate added in v0.2.3

func SessCreate(m *ice.Message, username, userrole string) string

func UserLogin added in v0.2.3

func UserLogin(m *ice.Message, username, password string) bool

func UserNick added in v0.2.4

func UserNick(m *ice.Message, username interface{}) (nick string)

func UserRole added in v0.2.3

func UserRole(m *ice.Message, username interface{}) (role string)

func UserRoot added in v0.2.3

func UserRoot(m *ice.Message)

func UserZone added in v0.2.4

func UserZone(m *ice.Message, username interface{}) (zone string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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