util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(hash, plain string) error

CheckPassword compares bcrypt hash and plain password. CheckPassword 比较 bcrypt 哈希与明文密码。

func HashPassword

func HashPassword(plain string) (string, error)

HashPassword hashes a plain password using bcrypt. HashPassword 使用 bcrypt 对明文密码进行哈希。

Types

type PageQuery

type PageQuery struct {
	Page     int
	PageSize int
}

PageQuery is a common pagination query. PageQuery 是通用分页查询参数。

func ParsePageQuery

func ParsePageQuery(c fiber.Ctx) PageQuery

ParsePageQuery parses ?page=&page_size= with sane defaults. ParsePageQuery 解析分页参数并提供合理默认值。

func (PageQuery) OffsetLimit

func (p PageQuery) OffsetLimit() (offset int, limit int)

OffsetLimit calculates SQL offset/limit. OffsetLimit 计算 SQL 的 offset/limit。

Jump to

Keyboard shortcuts

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