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: 0

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