model

package
v0.0.0-...-695ed52 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Car

type Car struct {
	ID       string   `json:"id"`
	Location Location `json:"location,omitempty"`
}

Car is an entity for car.

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

Location is a value object for location.

func (*Location) DistanceTo

func (x *Location) DistanceTo(other *Location, unit string) float64

DistanceTo will calculate the distance between two locations.

func (*Location) GetGoogleMaps

func (x *Location) GetGoogleMaps() string

GetGoogleMaps will return the google maps link of the location.

Jump to

Keyboard shortcuts

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