service

package
v0.0.0-...-65b1bfe Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSteamClient

func NewSteamClient(client HTTPClient) *steamClient

Types

type GameProcessor

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

func NewGameProcessor

func NewGameProcessor(storage persistence.StorageDB, steamClient SteamClient) *GameProcessor

func (*GameProcessor) GetGamesFromAPI

func (sv *GameProcessor) GetGamesFromAPI(ctx context.Context, items []entity.Item) ([][]byte, error)

func (*GameProcessor) ProcessResponse

func (sv *GameProcessor) ProcessResponse(responseData [][]byte, games []entity.Item) ([]steamapi.AppDetails, error)

func (*GameProcessor) RunProcessData

func (sv *GameProcessor) RunProcessData(ctx context.Context, limit int) error

func (*GameProcessor) UpdateData

func (sv *GameProcessor) UpdateData(games []entity.Item, id int64, isValid bool) error

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type ReviewsClient

type ReviewsClient interface {
	FetchReviews(appID int, typeReview string, limit string) (*model.ReviewResponse, error)
}

type SteamClient

type SteamClient interface {
	GetAppDetails(id int) ([]byte, error)
}

type SteamReviewAPI

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

func NewSteamReviewAPI

func NewSteamReviewAPI(client *http.Client) *SteamReviewAPI

func (*SteamReviewAPI) FetchReviews

func (s *SteamReviewAPI) FetchReviews(appID int, typeReview string, limit string) (*model.ReviewResponse, error)

FetchReviews obtiene las reseñas de un juego específico utilizando su appID. Acepta el appID del juego como argumento y devuelve un puntero a la estructura ReviewResponse que contiene la información de las reseñas, así como un posible error si ocurre.

Jump to

Keyboard shortcuts

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