api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Router *mux.Router

	GeoData map[string]models.AreasDataResults
	// contains filtered or unexported fields
}

API provides a struct to wrap the api around

func Setup

func Setup(ctx context.Context, cfg *config.Config, r *mux.Router, areaStore AreaStore, rdsConn *pgx.PGX) (*API, error)

Setup function sets up the api and returns an api

type AreaStore added in v0.3.0

type AreaStore interface {
	Close(ctx context.Context) error
	Checker(context.Context, *healthcheck.CheckState) error
	GetArea(ctx context.Context, id string) (*models.Area, error)
	GetVersion(ctx context.Context, id string, versionID int) (*models.Area, error)
	GetAreas(ctx context.Context, offset, limit int) (*models.AreasResults, error)
}

AreaStore represents all the required methods from mongo DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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