api

package
v0.0.0-...-1f1c4a4 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(ctx context.Context) error

Close represents the graceful shutting down of the http server

func CreateAndInitialiseSearchAPI

func CreateAndInitialiseSearchAPI(ctx context.Context, bindAddr string, esAPI Elasticsearcher, defaultMaxResults int, datasetIndex, postcodeIndex, boundaryFileIndex string, errorChan chan error)

CreateAndInitialiseSearchAPI manages all the routes configured to API

Types

type Elasticsearcher

type Elasticsearcher interface {
	AddBoundaryFile(ctx context.Context, indexName string, boundaryDoc *models.BoundaryDoc) (int, error)
	GetBoundaryFile(ctx context.Context, indexName, id string) (*models.BoundaryFileResponse, int, error)
	GetBoundaryFiles(ctx context.Context, indexName string, query interface{}) (*models.GeoResponseWithLocation, int, error)
	GetPostcodes(ctx context.Context, indexName, postcode string) (*models.PostcodeResponse, int, error)
	QueryGeoLocation(ctx context.Context, indexName string, geoLocation *models.GeoLocation, limit, offset int, relation string) (*models.GeoResponse, int, error)
}

Elasticsearcher - An interface used to access elasticsearch

type SearchAPI

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

SearchAPI manages searches across indices

Jump to

Keyboard shortcuts

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