utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertStringToSqlNullTime added in v0.4.0

func ConvertStringToSqlNullTime(timeString string) *sql.NullTime

func ConvertStringToTime added in v0.3.0

func ConvertStringToTime(timeString string) (*time.Time, error)

func FormatTimeStringForParsing added in v0.4.0

func FormatTimeStringForParsing(timeString string) string

Essentially this function it replaces "+09:00" type formats that are common from the end of some otherwise valid time strings so they can be used in Golang's time.Parse function.

func JsonToMap

func JsonToMap(jsonString string) ([][]map[string]interface{}, error)

Types

type WorkerScheduler

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

func NewWorkerScheduler

func NewWorkerScheduler(workerNum int, maxWorkEverySeconds int, ctx context.Context) (*WorkerScheduler, error)

NewWorkerScheduler 创建一个并行执行的调度器,控制最大运行数和每秒最大运行数量 NewWorkerScheduler Create a parallel scheduler to control the maximum number of runs and the maximum number of runs per second 注意: task执行是无序的 Warning: task execution is out of order

func (WorkerScheduler) Release

func (s WorkerScheduler) Release()

func (WorkerScheduler) Submit

func (s WorkerScheduler) Submit(task func() error) error

func (WorkerScheduler) WaitUntilFinish

func (s WorkerScheduler) WaitUntilFinish()

Jump to

Keyboard shortcuts

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