api

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is the data holder for the API

func NewAPI

func NewAPI(config *conf.Config, db *sql.DB) *API

NewAPI will create an api instance that is ready to start

func (*API) SearchNearbyStreets

func (api *API) SearchNearbyStreets(ctx echo.Context) error

func (*API) SearchNearbyTransportPoints

func (api *API) SearchNearbyTransportPoints(ctx echo.Context) error

func (*API) Start

func (api *API) Start() error

Start will start the API on the specified port

func (*API) Stop

func (api *API) Stop() error

Stop will shutdown the engine internally

type ErrorResponseItem

type ErrorResponseItem struct {
	Field   string `json:"field,omitempty"`
	Message string `json:"message"`
}

type ListResponse

type ListResponse struct {
	Page     int         `json:"page"`
	PageSize int         `json:"pageSize"`
	Total    int         `json:"total"`
	Items    interface{} `json:"items"`
}

type MessageResponse

type MessageResponse struct {
	Status  enums.APIResponseStatus `json:"status"`
	Message string                  `json:"message"`
	Errors  []ErrorResponseItem     `json:"errors,omitempty"`
}

Jump to

Keyboard shortcuts

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