helper

package
v0.0.0-...-6b858f3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWorkerNum = runtime.GOMAXPROCS(0) * 2

DefaultWorkerNum default number of goroutines is twice the number of GOMAXPROCS

View Source
var HttpClient = http.Client{
	Transport:     nil,
	CheckRedirect: nil,
	Jar:           nil,
	Timeout:       30 * time.Second,
}

Functions

func FileExists

func FileExists(path string) bool

Types

type AsyncResult

type AsyncResult struct {
	Value interface{}
	Err   error
}

AsyncResult result struct

type IAsync

type IAsync interface {
	AddTask(task Task)
	Result() []AsyncResult
}

IAsync interface

func NewAsync

func NewAsync(maxWorkerNum int) IAsync

NewAsync ...

type Task

type Task func() (interface{}, error)

Task task func

Jump to

Keyboard shortcuts

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