channels

package
v0.0.0-...-376a21c Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChanSvrStart = make(chan bool, 1)

Functions

func InitUrlExecutorThreadPool

func InitUrlExecutorThreadPool(threadCount int)

InitUrlExecutorThreadPool function is responsible to create goroutines for the provided thread count.

Types

type ExecFunc

type ExecFunc func(string, int, int64)

type UrlExecutor

type UrlExecutor interface {

	// Create function is responsible to create an object
	// of UrlExecutor
	Create() UrlExecutor

	// Build function is responsible to build an already
	// initialized UrlExecutor object.
	Build(url string, wg *sync.WaitGroup, fn ExecFunc) UrlExecutor

	// PushChannel function is responsible to push the built
	// UrlExecutor object to the channel.
	PushChannel()
}

UrlExecutor interface contains the functions to be implemented to execute a URL in a multi-threaded approach.

func NewTestUrlExecutor

func NewTestUrlExecutor() UrlExecutor

func NewUrlExecutor

func NewUrlExecutor() UrlExecutor

type UrlExecutorProvider

type UrlExecutorProvider interface {

	// Provide function is responsible to provide
	// UrlExecutor objects
	Provide() UrlExecutor
}

UrlExecutorProvider interface contains the functions to be implemented to create the provider the builds UrlExecutor objects

func NewUrlExecutorProvider

func NewUrlExecutorProvider(e UrlExecutor) UrlExecutorProvider

NewUrlExecutorProvider function is responsible to create urlExecutorProvider objects

Jump to

Keyboard shortcuts

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