password

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package password 密码类型的验证器

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(mod string, db *orm.DB)

Types

type Password

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

func New

func New(s *web.Server, prefix orm.Prefix, db *orm.DB) *Password

New 声明 Password 对象

prefix 表名前缀,当有多个不同实例时,prefix 不能相同。

func (*Password) Add

func (p *Password) Add(tx *orm.Tx, uid int64, identity, pass string) error

Add 添加账号

如果 tx 为空,那么将采用 orm.DB 访问数据库。

func (*Password) Change

func (p *Password) Change(tx *orm.Tx, uid int64, old, pass string) error

func (*Password) Delete

func (p *Password) Delete(tx *orm.Tx, uid int64) error

Delete 删除关联的密码信息

func (*Password) Identity

func (p *Password) Identity(uid int64) (string, bool)

func (*Password) Set

func (p *Password) Set(tx *orm.Tx, uid int64, pass string) error

Set 修改密码

func (*Password) Valid

func (p *Password) Valid(identity, pass string) (int64, string, bool)

Valid 验证登录正确性并返回其 uid

Jump to

Keyboard shortcuts

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