db

package
v0.0.0-...-8ca5219 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Conn *gorm.DB

Functions

func CountShips

func CountShips() (int, error)

func CountShipsOfType

func CountShipsOfType(shipType int) (int, error)

func DeleteMarketDataOlderThan

func DeleteMarketDataOlderThan(t time.Time) error

func GetMarketLocations

func GetMarketLocations() ([]string, error)

func GetShipDataByType

func GetShipDataByType(shipType int) ([]string, error)

func RecordMarketData

func RecordMarketData(location string, data string) error

Types

type Market

type Market struct {
	gorm.Model
	Location string
	Data     string
}

func GetLatestDataForLocation

func GetLatestDataForLocation(location string) (*Market, bool, error)

type Ship

type Ship struct {
	ID   string `gorm:"primarykey"`
	Type int
	Data string
}

func GetShip

func GetShip(id string) (*Ship, bool, error)

func (*Ship) Create

func (s *Ship) Create() error

Jump to

Keyboard shortcuts

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