ex_storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: BSD-2-Clause, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	ID       uint `gorm:"primaryKey"`
	Address  string
	GeoPoint georm.Point
}

type Route

type Route struct {
	ID       uint `gorm:"primaryKey"`
	Title    string
	GeoRoute georm.LineString
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(db *gorm.DB) *Storage

func (*Storage) AddAddresses

func (s *Storage) AddAddresses(address ...*Address) error

func (*Storage) AddRoute

func (s *Storage) AddRoute(route *Route) error

func (*Storage) AddZone

func (s *Storage) AddZone(zone *Zone) error

func (*Storage) DeleteAddress

func (s *Storage) DeleteAddress(id uint) error

func (*Storage) DeleteRoute

func (s *Storage) DeleteRoute(id uint) error

func (*Storage) DeleteZone

func (s *Storage) DeleteZone(id uint) error

func (*Storage) DropTables

func (s *Storage) DropTables() error

func (*Storage) FindAddressesInPolygon

func (s *Storage) FindAddressesInPolygon(polygon georm.Polygon) ([]Address, error)

FindAddressesInPolygon finds addresses that are inside a polygon

func (*Storage) FindRoutesInterZone

func (s *Storage) FindRoutesInterZone(zone *Zone) ([]Route, error)

FindRoutesInterZone finds routes that intersect with a zone

func (*Storage) FindZonesContainingPoint

func (s *Storage) FindZonesContainingPoint(point georm.Point) ([]Zone, error)

FindZonesContainingPoint finds zones that contain a point

func (*Storage) GetAddress

func (s *Storage) GetAddress(id uint) (*Address, error)

func (*Storage) GetRoute

func (s *Storage) GetRoute(id uint) (*Route, error)

func (*Storage) GetZone

func (s *Storage) GetZone(id uint) (*Zone, error)

func (*Storage) MigrationTables

func (s *Storage) MigrationTables() error

func (*Storage) UpdateAddress

func (s *Storage) UpdateAddress(address *Address) error

func (*Storage) UpdateRoute

func (s *Storage) UpdateRoute(route *Route) error

func (*Storage) UpdateZone

func (s *Storage) UpdateZone(zone *Zone) error

type Zone

type Zone struct {
	ID         uint `gorm:"primaryKey"`
	Title      string
	GeoPolygon georm.Polygon
}

Jump to

Keyboard shortcuts

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