utils

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: AGPL-3.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGoCvNotSetUp = errors.New("gocv not setup")

Functions

func ArgSplit

func ArgSplit(str string) (result []string)

func CompareId added in v0.0.10

func CompareId(number json.Number, _id interface{}) bool

CompareId 用_id的类型信息去转换number类型,并尝试比较

func DecodeGifWithCompleteFrame

func DecodeGifWithCompleteFrame(r io.Reader) (g *gif.GIF, err error)

func FilePathWalkDir

func FilePathWalkDir(root string) ([]string, error)

func FuncName

func FuncName() string

func GetGifDimensions

func GetGifDimensions(gif *gif.GIF) (x, y int)

func GroupLogFields added in v0.0.10

func GroupLogFields(groupCode int64) logrus.Fields

func ImageFormat

func ImageFormat(origImage []byte) (string, error)

func ImageGet

func ImageGet(url string, prefer proxy_pool.Prefer, opt ...requests.Option) ([]byte, error)

func ImageGetAndNorm

func ImageGetAndNorm(url string, prefer proxy_pool.Prefer) ([]byte, error)

func ImageNormSize

func ImageNormSize(origImage []byte) ([]byte, error)

func ImageReserve

func ImageReserve(imgBytes []byte) ([]byte, error)

func ImageSuffix

func ImageSuffix(name string) bool

func MessageFilter

func MessageFilter(msg []message.IMessageElement, filter func(message.IMessageElement) bool) []message.IMessageElement

func MessageTextf

func MessageTextf(format string, args ...interface{}) *message.TextElement

func MsgToString added in v0.0.10

func MsgToString(elements []message.IMessageElement) (res string)

func NewAnimeCascadeClassifier

func NewAnimeCascadeClassifier() gocv.CascadeClassifier

func NewFaceCascadeClassifier

func NewFaceCascadeClassifier() gocv.CascadeClassifier

func OpenCvAnimeFaceDetect

func OpenCvAnimeFaceDetect(imgBytes []byte) ([]byte, error)

func PrefixMatch

func PrefixMatch(opts []string, target string) (string, bool)

func Retry

func Retry(count int, interval time.Duration, f func() bool) bool

func Switch2Bool added in v0.0.10

func Switch2Bool(_s string) bool

func TimestampFormat

func TimestampFormat(ts int64) string

func ToDatas

func ToDatas(data interface{}) (requests.Datas, error)

func ToParams

func ToParams(get interface{}) (requests.Params, error)

func UnquoteString

func UnquoteString(s string) (string, error)

func UploadGroupImage

func UploadGroupImage(groupCode int64, img []byte, isNorm bool) (image *message.GroupImageElement, err error)

func UploadGroupImageByUrl

func UploadGroupImageByUrl(groupCode int64, url string, isNorm bool, prefer proxy_pool.Prefer) (*message.GroupImageElement, error)

Types

type EmitE

type EmitE struct {
	Id   interface{}
	Type concern.Type
}

func NewEmitE

func NewEmitE(id interface{}, t concern.Type) *EmitE

type EmitQueue

type EmitQueue struct {
	*sync.Cond

	TimeInterval time.Duration
	// contains filtered or unexported fields
}

func NewEmitQueue

func NewEmitQueue(c chan<- *EmitE, interval time.Duration) *EmitQueue

func (*EmitQueue) Add

func (q *EmitQueue) Add(e *EmitE, t time.Time)

func (*EmitQueue) Stop

func (q *EmitQueue) Stop()

Jump to

Keyboard shortcuts

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