gs

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterServers added in v0.5.0

func RegisterServers(servers []string)

Types

type BothWorker added in v0.3.0

type BothWorker struct {
	Client       *Client
	SenderWorker *SenderWorker
	ParserWorker *ParserWorker
	// contains filtered or unexported fields
}

func NewBothWorker added in v0.3.0

func NewBothWorker(client *Client, tag string, sender func(chan<- *api.Task), parser func(*api.Raw, *Client) error) *BothWorker

func (*BothWorker) GetName added in v0.4.0

func (w *BothWorker) GetName() string

func (*BothWorker) Run added in v0.3.0

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

type Client added in v0.3.1

type Client struct {
	api.GazerSystemClient
}

func NewClient

func NewClient(server string) *Client

func NewClientWithLB added in v0.5.0

func NewClientWithLB(servers ...string) *Client

func (*Client) SendOneTask added in v0.3.1

func (c *Client) SendOneTask(task *api.Task) error

func (*Client) SendTasks added in v0.3.1

func (c *Client) SendTasks(tasks []*api.Task) error

type GazerSystemResolver added in v0.5.0

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

GazerSystemResolver Resolver(https://godoc.org/google.golang.org/grpc/resolver#Resolver).

func (*GazerSystemResolver) Close added in v0.5.0

func (*GazerSystemResolver) Close()

func (*GazerSystemResolver) ResolveNow added in v0.5.0

type GazerSystemResolverBuilder added in v0.5.0

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

GazerSystemResolverBuilder ResolverBuilder(https://godoc.org/google.golang.org/grpc/resolver#Builder).

func (*GazerSystemResolverBuilder) Build added in v0.5.0

func (*GazerSystemResolverBuilder) Scheme added in v0.5.0

type ParserUnit added in v0.2.0

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

type ParserWorker added in v0.2.0

type ParserWorker struct {
	Client *Client
	Tag    string

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

func NewParserWorker added in v0.2.0

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

func (*ParserWorker) GetName added in v0.4.0

func (p *ParserWorker) GetName() string

func (*ParserWorker) Run added in v0.2.0

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

type SenderUnit added in v0.2.0

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

type SenderWorker added in v0.2.0

type SenderWorker struct {
	Client      *Client
	TaskChannel chan *api.Task
	Sender      func(chan<- *api.Task)
	// contains filtered or unexported fields
}

func NewSenderWorker added in v0.2.0

func NewSenderWorker(client *Client, name string, sender func(chan<- *api.Task)) *SenderWorker

func (*SenderWorker) GetName added in v0.4.0

func (s *SenderWorker) GetName() string

func (*SenderWorker) Run added in v0.2.0

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

type WorkUnit added in v0.2.0

type WorkUnit interface {
	Run(ctx context.Context)
	GetName() string
}

type Worker added in v0.2.0

type Worker interface {
	Run(ctx context.Context)
}

type WorkerGroup added in v0.2.0

type WorkerGroup struct {
	WorkerList []WorkUnit
	Server     string
	Client     *Client
}

func NewWorkerGroup added in v0.2.0

func NewWorkerGroup(servers ...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, *Client) 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