util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct{}

func New

func New() *Service

New 新建 Util 服务

func (*Service) BlackTokenKey

func (s *Service) BlackTokenKey(nanoid string) string

BlackTokenKey Token 黑名单缓存 key

func (*Service) CreateDir

func (s *Service) CreateDir(dir string) string

CreateDir 如果目录不存在, 则创建

func (*Service) Direct

func (s *Service) Direct(v reflect.Value) reflect.Value

Direct 获取反射指针类型

func (*Service) ExcpKey

func (s *Service) ExcpKey() string

ExcpKey 异常缓存 key

func (*Service) Init

func (s *Service) Init(...services.Service) services.Service

Init 初始化

func (*Service) IsExist

func (s *Service) IsExist(file string) bool

IsExist 判断文件是否存在

func (*Service) Nanoid

func (s *Service) Nanoid(args ...int) string

Nanoid 获取简单唯一 ID

func (*Service) Ptr

func (s *Service) Ptr(v any) any

Ptr 获取类型的指针类型

func (*Service) SHA256 added in v0.3.0

func (s *Service) SHA256(str string) string

SHA256 哈希计算

func (*Service) SecretKey

func (*Service) SecretKey(length int) (string, error)

SecretKey 加密安全的伪随机数生成器

func (*Service) SetEnv

func (*Service) SetEnv(env, key, value string) error

SetEnv 设置 env

Jump to

Keyboard shortcuts

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