handlers

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataFetch = errors.New("error al obtener datos")

Definir un error personalizado para cuando falle la obtención de datos.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	Applist struct {
		Apps []entity.Item `json:"apps"`
	} `json:"applist"`
}

APIResponse representa la estructura del JSON devuelto por la API.

type DataFetcher

type DataFetcher interface {
	GetData() ([]entity.Item, error)
}

DataFetcher representa la interfaz para obtener datos.

type RealDataFetcher

type RealDataFetcher struct{}

RealDataFetcher implementa DataFetcher para obtener datos reales de la API.

func (*RealDataFetcher) GetData

func (r *RealDataFetcher) GetData() ([]entity.Item, error)

GetData realiza una solicitud HTTP GET al endpoint de Steam para obtener los datos. Retorna una lista de elementos (Item) y un error en caso de que la solicitud falle o el JSON no pueda ser decodificado.

Jump to

Keyboard shortcuts

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