utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.1.8

func Contains(slice []string, item string) bool

func GetExecutablePath

func GetExecutablePath() string

func GetVersion added in v0.2.0

func GetVersion() (string, error)

func NewHTTPClient

func NewHTTPClient() *http.Client

func UpdateSubs

func UpdateSubs()

Types

type Task

type Task struct {
	ID     int
	Args   interface{}
	Result interface{}
	Err    error
}

type ThreadPool

type ThreadPool struct {
	NumWorkers int
	Tasks      chan Task
	Results    chan Task
	Wg         sync.WaitGroup
	TaskFunc   func(interface{}) (interface{}, error)
	// contains filtered or unexported fields
}

func NewThreadPool

func NewThreadPool(numWorkers int, taskFunc func(interface{}) (interface{}, error)) *ThreadPool

func (*ThreadPool) AddTaskArgs

func (tp *ThreadPool) AddTaskArgs(argsList []interface{})

func (*ThreadPool) GetResults

func (tp *ThreadPool) GetResults() []Task

func (*ThreadPool) Start

func (tp *ThreadPool) Start()

func (*ThreadPool) Wait

func (tp *ThreadPool) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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