utils

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 10 Imported by: 0

README

utils

update

- v0.1.4 对日志添加了追踪error发生位置的功能
- v0.1.3 更新log HandleErrors 级别
- v0.1.2 添加了CallPath 方法
- v0.1.1 更新了一些方法和处理bug
- v0.1.0 更新了 log safe_bool fast_locker

Documentation

Index

Constants

View Source
const (
	Version = "v0.1.4"
)

Variables

This section is empty.

Functions

func AesDecrypt added in v0.1.4

func AesDecrypt(encrypted string, key []byte) (string, error)

AesDecrypt aes解密 key: 16, 24, or 32 bytes to select

func AesEncrypt added in v0.1.4

func AesEncrypt(orig string, key []byte) (string, error)

AesEncrypt aes 加密 key: 16, 24, or 32 bytes to select

func CallPath added in v0.1.2

func CallPath(s int) string

func PKCS5Padding added in v0.1.4

func PKCS5Padding(text []byte, blockSize int) []byte

PKCS5Padding 密文填充

func PKCS5UnPadding added in v0.1.4

func PKCS5UnPadding(origData []byte) ([]byte, bool)

PKCS5UnPadding 取消填充

func RandSeq added in v0.1.4

func RandSeq(n int) string

RandSeq produce random string seq

Types

type FastLocker

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

func (*FastLocker) Lock

func (mu *FastLocker) Lock()

func (*FastLocker) Unlock

func (mu *FastLocker) Unlock()

type SafeBool

type SafeBool uint32

线程安全的标志位 set 方法保证置换操作的原子性

func (*SafeBool) ForceSetFalse

func (b *SafeBool) ForceSetFalse()

func (*SafeBool) ForceSetTrue

func (b *SafeBool) ForceSetTrue()

func (*SafeBool) IfTrue

func (b *SafeBool) IfTrue() bool

func (*SafeBool) SetFalse

func (b *SafeBool) SetFalse() bool

func (*SafeBool) SetTrue

func (b *SafeBool) SetTrue() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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