viability

package
v0.0.0-...-ffee078 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const COLLECTION = "splitters"

Variables

This section is empty.

Functions

func GetRouter

func GetRouter() *mux.Router

Types

type ClientErrorResponse

type ClientErrorResponse struct {
	Message string `json:"message"`
}

ClientErrorResponse é o modelo de resposta para requisições de código 4xx

type LocationResponse

type LocationResponse struct {
	Lat  float64 `json:"lat"`
	Long float64 `json:"long"`
}

type Point

type Point struct {
	Long float64
	Lat  float64
}

type PointSchema

type PointSchema struct {
	ID          primitive.ObjectID `json:"id" bson:"_id"`
	Type        string             `json:"type" bson:"type"`
	Coordinates []float64          `json:"coordinates" bson:"coordinates"`
}

type Repository

type Repository struct {
	Database   string
	Connection *mongo.Client
}

func (*Repository) Find

func (m *Repository) Find(searchDistance float64, searchPoint Point) ([]SplitterSchema, error)

type Response

type Response struct {
	IsApproved bool             `json:"isApproved"`
	Distance   float64          `json:"distance"`
	Splitter   ResponseSplitter `json:"splitter"`
}

Response é o modelo da resposta do método que realiza a viabilidade

type ResponseSplitter

type ResponseSplitter struct {
	ID       string           `json:"id"`
	Location LocationResponse `json:"location"`
}

type SplitterSchema

type SplitterSchema struct {
	ID       primitive.ObjectID `json:"id" bson:"_id"`
	Location PointSchema        `json:"location" bson:"location"`
}

Jump to

Keyboard shortcuts

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