api

package
v0.0.0-...-5298318 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(message string, statusCode int) (events.APIGatewayProxyResponse, error)

func ParseCoordinates

func ParseCoordinates(params map[string]string) (float64, float64, error)

Parameter parsing helpers

func Success

func Success(body interface{}) (events.APIGatewayProxyResponse, error)

Response helpers

Types

type APIError

type APIError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

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

Jump to

Keyboard shortcuts

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