internal

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecrptogDES added in v1.3.0

func DecrptogDES(src, key, iv []byte) []byte

DecrptogDES

func DownWebImage

func DownWebImage(url, dir string) (string, error)

DownWebImage 下载网络图片,返回图片路径, 支持不带文件后缀的路径。

func EncyptogDES added in v1.3.0

func EncyptogDES(src, key, iv []byte) []byte

EncyptogDES

func GenerateHexString

func GenerateHexString(len int8) string

GenerateHexString 随机生成指定位数(必须是偶数)的HexString

func IsFileOrDirExist

func IsFileOrDirExist(addr string) bool

判断文件或者目录是否存在

func TryDecrptogDES added in v1.3.1

func TryDecrptogDES(src, key, iv []byte) (dst []byte, err error)

TryDecrptogDES 不直接Panic

func WriteToFile

func WriteToFile(fileName string, content string) error

WriteToFile 覆盖式写入文件,如果文件不存在则创建写入

Types

type MySet

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

MySet 自定义的一个线程安全的set

func NewMySet

func NewMySet() *MySet

func (*MySet) Add

func (set *MySet) Add(item any) bool

func (*MySet) Del

func (set *MySet) Del(item any)

func (*MySet) IsExist

func (set *MySet) IsExist(item any) bool

func (*MySet) Iterator

func (set *MySet) Iterator() []any

func (*MySet) Len

func (set *MySet) Len() int

type MySync

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

MySync 利用channal的缓冲区实现一个限流器。 用来限制 gorotine 并发数量,并且等待所有 gorotine 结束

func NewMySync

func NewMySync(maxConcurrent int) *MySync

func (*MySync) Add

func (my *MySync) Add(num int)

func (*MySync) Done

func (my *MySync) Done(num int)

func (*MySync) Wait

func (my *MySync) Wait()

Wait 通过定时 loop 是否结束

type Seter

type Seter interface {
	Add(any) bool
	Del(any)
	IsExist(any) bool
	Len() int
	Iterator() []any
}

Seter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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