service

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAuthorsRequest added in v0.2.0

type GetAuthorsRequest struct {
	Name  string `validate:"omitempty,gte=3" mod:"trim,lcase"`
	Page  int    `validate:"required,gte=1" mod:"default=1"`
	Limit int    `validate:"required,gte=-1" mod:"default=20"`
}

GetAuthorsRequest is get authors request model.

type GetGenresRequest added in v0.2.0

type GetGenresRequest struct {
	Name  string `validate:"omitempty,gte=3" mod:"trim,lcase"`
	Page  int    `validate:"required,gte=1" mod:"default=1"`
	Limit int    `validate:"required,gte=-1" mod:"default=20"`
}

GetGenresRequest is get genres request model.

type GetMagazinesRequest added in v0.2.0

type GetMagazinesRequest struct {
	Name  string `validate:"omitempty,gte=3" mod:"trim,lcase"`
	Page  int    `validate:"required,gte=1" mod:"default=1"`
	Limit int    `validate:"required,gte=-1" mod:"default=20"`
}

GetMagazinesRequest is get magazines request model.

type GetMangaRequest added in v0.2.0

type GetMangaRequest struct {
	Mode      entity.SearchMode `validate:"oneof=ALL SIMPLE" mod:"default=SIMPLE,trim,ucase"`
	Title     string            `validate:"omitempty,gte=3" mod:"trim,lcase"`
	Type      entity.Type       `validate:"omitempty,oneof=MANGA NOVEL ONE_SHOT DOUJINSHI MANHWA MANHUA OEL LIGHT_NOVEL" mod:"trim,ucase"`
	StartDate string            `validate:"omitempty,datetime=2006-01-02" mod:"trim"`
	EndDate   string            `validate:"omitempty,datetime=2006-01-02" mod:"trim"`
	NSFW      *bool             ``
	Sort      string            `` /* 177-byte string literal not displayed */
	Page      int               `validate:"required,gte=1" mod:"default=1"`
	Limit     int               `validate:"required,gte=-1" mod:"default=20"`
}

GetMangaRequest is get manga request model.

type GetUserMangaRequest

type GetUserMangaRequest struct {
	Username string `validate:"required" mod:"trim,lcase"`
	Page     int    `validate:"required,gte=1" mod:"default=1"`
	Limit    int    `validate:"required,gte=-1" mod:"default=20"`
}

GetUserMangaRequest is get user manga request model.

type Service

type Service interface {
	GetManga(ctx context.Context, data GetMangaRequest) ([]manga, *pagination, int, error)
	GetMangaByID(ctx context.Context, id int64) (*manga, int, error)

	GetAuthors(ctx context.Context, data GetAuthorsRequest) ([]author, *pagination, int, error)
	GetGenres(ctx context.Context, data GetGenresRequest) ([]genre, *pagination, int, error)
	GetMagazines(ctx context.Context, data GetMagazinesRequest) ([]magazine, *pagination, int, error)

	GetUserManga(ctx context.Context, data GetUserMangaRequest) ([]userManga, *pagination, int, error)

	ConsumeMessage(ctx context.Context, msg entity.Message) error

	QueueOldReleasingManga(ctx context.Context, limit int) (int, int, error)
	QueueOldFinishedManga(ctx context.Context, limit int) (int, int, error)
	QueueOldNotYetManga(ctx context.Context, limit int) (int, int, error)
	QueueMissingManga(ctx context.Context, limit int) (int, int, error)
	QueueOldUserManga(ctx context.Context, limit int) (int, int, error)
}

Service contains functions for service.

Jump to

Keyboard shortcuts

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