aaa

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ROOT = "root"
	TECH = "tech"
	VOID = "void"
)
View Source
const (
	BLACK = "black"
	WHITE = "white"
	RIGHT = "right"
)
View Source
const (
	IP = "ip"
	UA = "ua"
)
View Source
const (
	LOGIN  = "login"
	LOGOUT = "logout"
)
View Source
const (
	SECRET = "secret"
	PERIOD = "period"
	NUMBER = "number"
)
View Source
const (
	AVATAR = "avatar"
	GENDER = "gender"
	MOBILE = "mobile"
	EMAIL  = "email"

	CITY     = "city"
	COUNTRY  = "country"
	PROVINCE = "province"
	LANGUAGE = "language"

	BACKGROUND = "background"
)
View Source
const (
	USERZONE = "userzone"
	USERNICK = "usernick"
	USERROLE = "userrole"
	USERNAME = "username"
	PASSWORD = "password"
)
View Source
const (
	USER_CREATE = "user.create"
	USER_REMOVE = "user.remove"
)
View Source
const AAA = "aaa"
View Source
const (
	INVITE = "invite"
)
View Source
const ROLE = "role"
View Source
const SESS = "sess"
View Source
const (
	SESS_CREATE = "sess.create"
)
View Source
const TOTP = "totp"
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, mdb.CREATE, USER, m.Prefix(USER))
	}},
	ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
		m.Save()
	}},
}}

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)

func SessCreate added in v0.2.3

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

func SessIsCli added in v0.3.4

func SessIsCli(m *ice.Message) bool

func TOTP_GET added in v0.2.9

func TOTP_GET(key string, num int, per int64) 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