api

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 13 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, rdsStore RDSAreaStore) (*API, error)

Setup function sets up the api and returns an api

type AncestorStore added in v0.10.0

type AncestorStore interface {
	GetAncestors(areaID string) ([]models.AreasAncestors, error)
}

Ancestors defines a method to lookup ancestors from an areaID

type Ancestry added in v0.10.0

type Ancestry struct{}

Ancestry implements the AcestorStore interface

func (Ancestry) GetAncestors added in v0.10.0

func (a Ancestry) GetAncestors(areaID string) ([]models.AreasAncestors, error)

GetAncestors retrieves AreaAncestors by ID from stubbed data for now

type RDSAreaStore added in v0.10.0

type RDSAreaStore interface {
	Init(ctx context.Context, cfg *config.Config) error
	Close()
	GetRelationships(areaCode string) ([]*models.AreaBasicData, error)
	ValidateArea(code string) error
	GetArea(ctx context.Context, areaId string) (*models.AreasDataResults, error)
	BuildTables(ctx context.Context, executionList []string) error
	Ping(ctx context.Context) error
	UpsertArea(ctx context.Context, area models.AreaParams) (bool, error)
}

RDSAreaStore represents all the required methods from aurora DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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