Documentation
¶
Index ¶
- func Error(message string, statusCode int) (events.APIGatewayProxyResponse, error)
- func ParseCoordinates(params map[string]string) (float64, float64, error)
- func Success(body interface{}) (events.APIGatewayProxyResponse, error)
- type APIError
- type APIResponder
- type APIResponse
- type ErrorResponse
- type InvalidCoordinatesError
- type StationsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCoordinates ¶
Parameter parsing helpers
func Success ¶
func Success(body interface{}) (events.APIGatewayProxyResponse, error)
Response helpers
Types ¶
type APIResponder ¶
type APIResponder interface {
GetResponseType() string
}
type APIResponse ¶
type APIResponse struct {
ResponseType string `json:"responseType"`
}
func (APIResponse) GetResponseType ¶
func (r APIResponse) GetResponseType() string
type ErrorResponse ¶
type ErrorResponse struct {
APIResponse
Error string `json:"error"`
}
func NewErrorResponse ¶
func NewErrorResponse(message string) *ErrorResponse
type InvalidCoordinatesError ¶
type InvalidCoordinatesError struct{}
func (InvalidCoordinatesError) Error ¶
func (e InvalidCoordinatesError) Error() string
type StationsResponse ¶
type StationsResponse struct {
APIResponse
Stations []models.Station `json:"stations"`
}
func NewStationsResponse ¶
func NewStationsResponse(stations []models.Station) *StationsResponse
Click to show internal directories.
Click to hide internal directories.