crawlerusecase

package
v0.0.0-...-1202c29 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package usecase implements application business logic. Each logic group in own file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crawler

type Crawler interface {
	CrawlStory(ctx context.Context, url string) (entity.Story, error)
	CrawlStoryBySlug(ctx context.Context, slug string) (entity.Story, error)
	CrawlChapters(ctx context.Context, url string) ([]entity.Chapter, error)
	CrawlChapter(ctx context.Context, url string) (entity.Chapter, error)
	CrawlChapterBySlug(ctx context.Context, sSlug string, cSlug string) (entity.Chapter, error)
}

Crawler -.

type CrawlerRepo

type CrawlerRepo interface {
	StoreStory(context.Context, *entity.Story) error
	StoreStoryRate(context.Context, *entity.StoryRate) error
	StoreStoryList(context.Context, *entity.StoryList) error
	StoreCategory(context.Context, *entity.Category) error
	StoreChapter(context.Context, *entity.Chapter) error
	StoreChapters(context.Context, *[]entity.Chapter) error
	StoreAuthor(context.Context, *entity.Author) error
	FindStory(context.Context, entity.Story, *entity.Story) error
}

CrawlerRepo -.

type CrawlerUseCase

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

CrawlerUseCase -.

func New

New -.

func (*CrawlerUseCase) CrawlChapter

func (uc *CrawlerUseCase) CrawlChapter(ctx context.Context, url string) (entity.Chapter, error)

func (*CrawlerUseCase) CrawlChapterBySlug

func (uc *CrawlerUseCase) CrawlChapterBySlug(ctx context.Context, sSlug string, cSlug string) (entity.Chapter, error)

func (*CrawlerUseCase) CrawlChapters

func (uc *CrawlerUseCase) CrawlChapters(ctx context.Context, url string) ([]entity.Chapter, error)

func (*CrawlerUseCase) CrawlStory

func (uc *CrawlerUseCase) CrawlStory(ctx context.Context, url string) (entity.Story, error)

func (*CrawlerUseCase) CrawlStoryBySlug

func (uc *CrawlerUseCase) CrawlStoryBySlug(ctx context.Context, slug string) (entity.Story, error)

type TruyenFullWebAPI

type TruyenFullWebAPI interface {
	GetStoryChapters(story entity.Story, opt map[string]string) (truyenfullwebapi.GetStoryChaptersResponse, error)
	GetStoryURLBySlug(slug string) string
	GetChapterURLBySlug(sSlug string, cSlug string) string
	ExtractStorySlug(url string) string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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