plugin

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCClient

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

func (*GRPCClient) Scrap

func (m *GRPCClient) Scrap(Title string, Page, Quantity int) model.Comic

func (*GRPCClient) ScrapPerChapter

func (m *GRPCClient) ScrapPerChapter(Title, Id string) model.Chapter

type GRPCPlugin

type GRPCPlugin struct {
	plugin.Plugin
	Impl Scrapper
}

func (*GRPCPlugin) GRPCClient

func (p *GRPCPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

func (*GRPCPlugin) GRPCServer

func (p *GRPCPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

type GRPCServer

type GRPCServer struct {
	// This is the real implementation
	Impl Scrapper
}

Here is the gRPC server that GRPCClient talks to.

func (*GRPCServer) Scrap

func (*GRPCServer) ScrapPerChapter

type RPCClient

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

func (*RPCClient) ScrapAll

func (m *RPCClient) ScrapAll(Title string) (model.Comic, error)

func (*RPCClient) ScrapPerChapter

func (m *RPCClient) ScrapPerChapter(Title, Id string) (model.Chapter, error)

type RPCServer

type RPCServer struct {
	// This is the real implementation
	Impl Scrapper
}

func (*RPCServer) Scrap

func (m *RPCServer) Scrap(Title string, Page, Quantity int, resp *model.Comic) error

func (*RPCServer) ScrapPerChapter

func (m *RPCServer) ScrapPerChapter(args map[string]interface{}, resp *model.Chapter) error

type Scrapper

type Scrapper interface {
	// ScrapAll(Title string) model.Comic
	ScrapPerChapter(Title, Id string) model.Chapter
	Scrap(Title string, Page, Quantity int) model.Comic
}

type ScrapperPlugin

type ScrapperPlugin struct {
	Impl Scrapper
}

func (*ScrapperPlugin) Client

func (*ScrapperPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*ScrapperPlugin) Server

func (p *ScrapperPlugin) Server(*plugin.MuxBroker) (interface{}, error)

Jump to

Keyboard shortcuts

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