service

package
v0.0.0-...-c266f6d Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrawService

type CrawService interface {
	PickAgent(context.Context, *dto.Site) (*dto.Node, error)
	Craw(context.Context, *dto.Site) error
}

type CrawServiceImpl

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

func NewCrawService

func NewCrawService(site repo.SiteRepo, node repo.NodeRepo) *CrawServiceImpl

func (*CrawServiceImpl) Craw

func (c *CrawServiceImpl) Craw(ctx context.Context, site *dto.Site) error

func (*CrawServiceImpl) PickAgent

func (c *CrawServiceImpl) PickAgent(ctx context.Context, site *dto.Site) (*dto.Node, error)

type FavorService

type FavorService interface {
	UserFavors(context.Context, int, string, string) ([]*dto.Favor, error)
	UserFavorSites(context.Context, int, string) ([]string, error)

	Add(context.Context, *dto.Favor) error
	Del(context.Context, int, string, string) error
}

type FavorServiceImpl

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

func NewFavorService

func NewFavorService(repo repo.FavorRepo) *FavorServiceImpl

func (*FavorServiceImpl) Add

func (s *FavorServiceImpl) Add(ctx context.Context, favor *dto.Favor) error

func (*FavorServiceImpl) Del

func (s *FavorServiceImpl) Del(ctx context.Context, uid int, site string, key string) error

func (*FavorServiceImpl) UserFavorSites

func (s *FavorServiceImpl) UserFavorSites(ctx context.Context, uid int, keyword string) ([]string, error)

func (*FavorServiceImpl) UserFavors

func (s *FavorServiceImpl) UserFavors(ctx context.Context, uid int, site string, keyword string) ([]*dto.Favor, error)

type NodeService

type NodeService interface {
	CheckNodes(context.Context, *rpc.RpcPool) error
	Upsert(context.Context, *dto.Node) error
	Del(context.Context, int) error
	Get(context.Context, *dto.Query) ([]*dto.Node, error)
}

type NodeServiceImpl

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

func NewNodeService

func NewNodeService(repo repo.NodeRepo) *NodeServiceImpl

func (*NodeServiceImpl) CheckNodes

func (s *NodeServiceImpl) CheckNodes(ctx context.Context, clientPool *rpc.RpcPool) error

func (*NodeServiceImpl) Del

func (s *NodeServiceImpl) Del(ctx context.Context, id int) error

func (*NodeServiceImpl) Get

func (s *NodeServiceImpl) Get(ctx context.Context, q *dto.Query) ([]*dto.Node, error)

func (*NodeServiceImpl) Upsert

func (s *NodeServiceImpl) Upsert(ctx context.Context, node *dto.Node) error

type OAuthService

type OAuthService interface {
	Platforms(string) []dto.OAuthPlatform
	GetPlatform(string) oauth.OAuth
	Redirect(string) string
	Auth(string, string) (oauth.User, error)
}

type OAuthServiceImpl

type OAuthServiceImpl struct {
}

func NewOAuthService

func NewOAuthService() *OAuthServiceImpl

func (*OAuthServiceImpl) Auth

func (s *OAuthServiceImpl) Auth(t string, code string) (oauth.User, error)

func (*OAuthServiceImpl) GetPlatform

func (s *OAuthServiceImpl) GetPlatform(t string) oauth.OAuth

func (*OAuthServiceImpl) Platforms

func (s *OAuthServiceImpl) Platforms(from string) []dto.OAuthPlatform

func (*OAuthServiceImpl) Redirect

func (s *OAuthServiceImpl) Redirect(t string) string

type SiteService

type SiteService interface {
	Init(context.Context) error
	ListOfIndex(context.Context) ([]*dto.IndexSite, error)
	News(context.Context, int, string, string) (*dto.News, error)

	Upsert(context.Context, *dto.Site) error
	Del(context.Context, int) error
	Get(context.Context, *dto.Query) ([]*dto.Site, error)
}

type SiteServiceImpl

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

func NewSiteService

func NewSiteService(repo repo.SiteRepo, favor repo.FavorRepo) *SiteServiceImpl

func (*SiteServiceImpl) Del

func (s *SiteServiceImpl) Del(ctx context.Context, id int) error

func (*SiteServiceImpl) Get

func (s *SiteServiceImpl) Get(ctx context.Context, q *dto.Query) ([]*dto.Site, error)

func (*SiteServiceImpl) Init

func (s *SiteServiceImpl) Init(ctx context.Context) error

func (*SiteServiceImpl) ListOfIndex

func (s *SiteServiceImpl) ListOfIndex(ctx context.Context) ([]*dto.IndexSite, error)

func (*SiteServiceImpl) News

func (s *SiteServiceImpl) News(ctx context.Context, loginUser int, k string, kk string) (*dto.News, error)

func (*SiteServiceImpl) Upsert

func (s *SiteServiceImpl) Upsert(ctx context.Context, site *dto.Site) error

type UserService

type UserService interface {
	GetUserList(context.Context) ([]*dto.User, error)
	GetUser(context.Context, *dto.Query) (*dto.User, error)
	Auth(context.Context, string, oauth.User) (string, error)
	VerifyToken(context.Context, string, string) bool
}

type UserServiceImpl

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

func NewUserService

func NewUserService(repo repo.UserRepo) *UserServiceImpl

func (*UserServiceImpl) Auth

func (s *UserServiceImpl) Auth(ctx context.Context, t string, ou oauth.User) (string, error)

func (*UserServiceImpl) GetUser

func (s *UserServiceImpl) GetUser(ctx context.Context, q *dto.Query) (*dto.User, error)

func (*UserServiceImpl) GetUserList

func (s *UserServiceImpl) GetUserList(ctx context.Context) ([]*dto.User, error)

func (*UserServiceImpl) VerifyToken

func (s *UserServiceImpl) VerifyToken(ctx context.Context, username string, token string) bool

Jump to

Keyboard shortcuts

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