api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamOffset = "offset"
	ParamLimit  = "limit"
)

Variables

This section is empty.

Functions

func GetResources added in v1.1.0

func GetResources(api *API) http.HandlerFunc

GetResources returns all resources that are wanted to be indexed in search

Types

type API

type API struct {
	Router    *mux.Router
	Cfg       *config.Config
	DataStore DataStorer
}

API provides a struct to wrap the api around

func Setup

func Setup(r *mux.Router, cfg *config.Config, dataStorer DataStorer) *API

Setup function sets up the api and returns an api

type DataStorer added in v1.1.0

type DataStorer interface {
	GetResources(ctx context.Context, options data.Options) (resource *models.Resources, err error)
}

DataStorer is an interface for a type that can store and retrieve resources

type Paginator added in v1.1.0

type Paginator interface {
	ValidateParameters(offsetParam string, limitParam string, totalCount int) (offset int, limit int, err error)
}

Paginator defines the required methods from the paginator package

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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