api

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAPI

func RunAPI(ctx context.Context, wg *sync.WaitGroup, log *zap.Logger, db *database.Database, cfg *config.Config, st *strava.Strava, im *importer.Importer, q *queue.Queue)

Types

type API

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

func (*API) GetPageAndSize

func (a *API) GetPageAndSize(c echo.Context, defaultPageSize int64) (int64, int64, error)

GetPageAndSize retrieves the pagination parameters (page and page size) from the query parameters of the request context. If no parameters are provided, it uses the default page size. It also ensures the page and page size values are valid. Returns the offset for database queries, the page size, and an error if any of the parameters are invalid.

type ErrorResponse added in v0.1.0

type ErrorResponse struct {
	Errors map[string]string `json:"errors"`
}

type PaginatedResponse

type PaginatedResponse struct {
	Results interface{} `json:"results"`
	Count   int64       `json:"count"`
}

Directories

Path Synopsis
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.

Jump to

Keyboard shortcuts

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