Documentation
¶
Index ¶
- type Location
- type LocationService
- func (l *LocationService) CreateLocation(location *Location) (uint, error)
- func (l *LocationService) GetAllLocations() ([]Location, error)
- func (l *LocationService) GetClosestLocation(latitude float64, longitude float64, treshold int) ([]Location, error)
- func (l *LocationService) GetLoactionExistance(ids []uint) (bool, error)
- func (l *LocationService) GetLocationById(id uint) (*Location, error)
- func (l *LocationService) UpdateLocation(location *Location) error
- type Locations
- type Reader
- type Repo
- func (l *Repo) CreateLocation(location *Location) (uint, error)
- func (l *Repo) GetAllLocations() ([]Location, error)
- func (l *Repo) GetClosestLocation(latitude_north float64, latitude_south float64, longitude_west float64, ...) ([]Location, error)
- func (l *Repo) GetLoactionExistance(ids []uint) (bool, error)
- func (l *Repo) GetLocationById(id uint) (*Location, error)
- func (l *Repo) UpdateLocation(location *Location) error
- type Repository
- type Service
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct { common.Timestamp ID uint `gorm:"primaryKey"` Latitude float64 `gorm:"column:latitude"` Longitude float64 `gorm:"column:longitude"` Name string `gorm:"column:name"` Description string `gorm:"column:description"` FullDescription string `gorm:"column:fullDescription"` Altitude int `gorm:"column:altitude"` Country string `gorm:"column:contry"` CountryPart string `gorm:"column:contryPart"` City string `gorm:"column:city"` }
Location describes a location... Just like the name intends
func (*Location) CoordinatesFromRadius ¶
CoordinatesFromRadius returns coordinates in the radius arround the location `radius` is in meters returns (lat-north, lat-south, long-west, long-east)
type LocationService ¶
type LocationService struct {
// contains filtered or unexported fields
}
func (*LocationService) CreateLocation ¶
func (l *LocationService) CreateLocation(location *Location) (uint, error)
CreateLocation Create location
func (*LocationService) GetAllLocations ¶
func (l *LocationService) GetAllLocations() ([]Location, error)
GetAllLocations get all locations
func (*LocationService) GetClosestLocation ¶
func (*LocationService) GetLoactionExistance ¶
func (l *LocationService) GetLoactionExistance(ids []uint) (bool, error)
func (*LocationService) GetLocationById ¶
func (l *LocationService) GetLocationById(id uint) (*Location, error)
GetLocationById gets a single location by ID
func (*LocationService) UpdateLocation ¶
func (l *LocationService) UpdateLocation(location *Location) error
UpdateLocation Update location
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func NewRepository ¶
NewRepository creates a new repository
func (*Repo) GetAllLocations ¶
func (*Repo) GetClosestLocation ¶
func (*Repo) UpdateLocation ¶
type Repository ¶
Click to show internal directories.
Click to hide internal directories.