custom

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: 6 Imported by: 0

Documentation

Overview

Package custom 自定义验证方法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

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

Types

type Func

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

func New

func New(s *web.Server, tableName orm.Prefix, db *orm.DB, f func(string, string) bool) *Func

Func 以函数的方式验证账号密码

f 用于验证账号和密码的正确性。

func (*Func) Add

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

Add 添加账号

将 uid 与 identity 作关联

func (*Func) Delete

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

Delete 删除关联信息

func (*Func) Identity

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

func (*Func) Valid

func (p *Func) 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