gs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(server string) api.GazerSystemClient

Types

type ParserUnit added in v0.2.0

type ParserUnit interface {
	Parser(raw *api.Raw) error
	GetTargetURL() *url.URL
}

type ParserWorker added in v0.2.0

type ParserWorker struct {
	GazerSystemClient api.GazerSystemClient
	Tag               string

	Parser func(*api.Raw) error
	// contains filtered or unexported fields
}

func NewParserWorker added in v0.2.0

func NewParserWorker(gazerSystemClient api.GazerSystemClient, tag string, parser func(*api.Raw) error) *ParserWorker

func (*ParserWorker) Run added in v0.2.0

func (w *ParserWorker) Run(ctx context.Context)

type SenderUnit added in v0.2.0

type SenderUnit interface {
	Sender(chan<- string)
}

type SenderWorker added in v0.2.0

type SenderWorker struct {
	GazerSystemClient api.GazerSystemClient

	Sender func(chan<- *api.Task)
	// contains filtered or unexported fields
}

func NewSenderWorker added in v0.2.0

func NewSenderWorker(gazerSystemClient api.GazerSystemClient, sender func(chan<- *api.Task)) *SenderWorker

func (*SenderWorker) Run added in v0.2.0

func (w *SenderWorker) Run(ctx context.Context)

type WorkUnit added in v0.2.0

type WorkUnit interface {
	Sender(chan<- *api.Task)
	Parser(*api.Raw) error
	GetTag() string
}

type Worker added in v0.2.0

type Worker struct {
	Worker       api.GazerSystemClient
	SenderWorker *SenderWorker
	ParserWorker *ParserWorker
}

func NewWorker added in v0.2.0

func NewWorker(server string, tag string, sender func(chan<- *api.Task), parser func(*api.Raw) error) *Worker

func (*Worker) Run added in v0.2.0

func (w *Worker) Run(ctx context.Context)

type WorkerGroup added in v0.2.0

type WorkerGroup struct {
	WorkerList []*Worker
	Server     string
}

func NewWorkerGroup added in v0.2.0

func NewWorkerGroup(server string) *WorkerGroup

func (*WorkerGroup) AddByWorkUnit added in v0.2.0

func (g *WorkerGroup) AddByWorkUnit(w WorkUnit)

func (*WorkerGroup) AddWorker added in v0.2.0

func (g *WorkerGroup) AddWorker(targetURL string, sender func(chan<- *api.Task), parser func(*api.Raw) error)

func (*WorkerGroup) Run added in v0.2.0

func (g *WorkerGroup) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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