authdb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(configFile string)

Setup 安装authdb所需资源

Types

type AuthMYSQL

type AuthMYSQL struct {
	// contains filtered or unexported fields
}

AuthMYSQL mysql 授权验证器

func Init

func Init(configFile string) (*AuthMYSQL, error)

Init 创建一个MYSQL授权,验证器

func (*AuthMYSQL) ACL

func (slf *AuthMYSQL) ACL(action, clientID, username, ip, topic string) (bool, error)

ACL 验证访问主题授权

func (*AuthMYSQL) Connect

func (slf *AuthMYSQL) Connect(clientID, username, password string) (bool, error)

Connect 验证连接请求

type AuthUser

type AuthUser struct {
	ClientID string `gorm:"primary_key;type:varchar(64);not null;"`
	UserName string `gorm:"type:varchar(32);not null;index:user_idx;"`
	Password string `gorm:"type:varchar(32);not null;"`
	CreateAt time.Time
	UpdateAt time.Time
}

AuthUser 授权用户表

Jump to

Keyboard shortcuts

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