tools

package
v0.0.0-...-dfd69a5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Sec3  = time.Second * 3
	Sec5  = time.Second * 5
	Sec10 = time.Second * 10
	Sec20 = time.Second * 20
)

Variables

This section is empty.

Functions

func DistinctString

func DistinctString(arr []string) []string

DistinctString 对字符串数组进行去重

func ExecuteTemplate

func ExecuteTemplate(templateString interface{}, data map[string]interface{}) (string, error)

func InArray

func InArray(s string, list []string) bool

InArray check if string s is in the list

func NewTemplate

func NewTemplate(s string) (*template.Template, error)

func ParseSearch

func ParseSearch(query string, keys ...string) (map[string]string, string)

func TimeoutCtx

func TimeoutCtx(timeout time.Duration) context.Context

func TimeoutCtxF

func TimeoutCtxF(timeout time.Duration) (context.Context, func())

func ValidUsername

func ValidUsername(name string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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