helper

package
v0.0.0-...-d63a0bf Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrawlRepo

func CrawlRepo(githubRepo repository.GithubRepo)

Types

type Job

type Job interface {
	Process()
}

Job - interface for job processing

type JobQueue

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

JobQueue - a queue for enqueueing jobs to be processed

func NewJobQueue

func NewJobQueue(maxWorkers int) *JobQueue

NewJobQueue - creates a new job queue

func (*JobQueue) Start

func (q *JobQueue) Start()

Start - starts the worker routines and dispatcher routine

func (*JobQueue) Stop

func (q *JobQueue) Stop()

Stop - stops the workers and dispatcher routine

func (*JobQueue) Submit

func (q *JobQueue) Submit(job Job)

Submit - adds a new job to be processed

type RepoProcess

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

func (*RepoProcess) Process

func (rp *RepoProcess) Process()

type StructValidator

type StructValidator struct {
	Validator *validator.Validate
	Uni       *ut.UniversalTranslator
	Trans     ut.Translator
}

func NewStructValidator

func NewStructValidator() *StructValidator

func (*StructValidator) RegisterValidate

func (cv *StructValidator) RegisterValidate()

func (*StructValidator) Validate

func (cv *StructValidator) Validate(i interface{}) error

type Worker

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

Worker - the worker threads that actually process the jobs

func NewWorker

func NewWorker(readyPool chan chan Job, done *sync.WaitGroup) *Worker

NewWorker - creates a new worker

func (*Worker) Start

func (w *Worker) Start()

Start - begins the job processing loop for the worker

func (*Worker) Stop

func (w *Worker) Stop()

Stop - stops the worker

Jump to

Keyboard shortcuts

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