utils

package
v0.0.0-...-afd247e Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlmostEqual

func AlmostEqual(a, b float64) bool

AlmostEqual 比较float64

func GetMD5Hash

func GetMD5Hash(text string) string

func GetRandomCode

func GetRandomCode(max int) string

Types

type Roles

type Roles []int

Roles 用户角色组

func RolesAssert

func RolesAssert(in interface{}) Roles

RolesAssert 类型转换为Roles

func (Roles) Are

func (r Roles) Are(rs []int) bool

Are 用户是否是指定角色的其中一个

func (Roles) Is

func (r Roles) Is(role int) bool

Is 用户是否是指定角色

func (Roles) IsGuest

func (r Roles) IsGuest() bool

IsGuest 用户是否访客

Jump to

Keyboard shortcuts

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