backend

package
v0.0.0-...-08eab16 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Router    *mux.Router
	ModelPool *ModelPool
}

func NewApp

func NewApp(modelPool *ModelPool) *App

func (*App) Run

func (a *App) Run(addr string)

type Circle

type Circle struct {
	Center   Coord
	RadiusKm float64
}

type Coord

type Coord struct {
	Lat, Long float64
}

type JourneyData

type JourneyData struct {
	Egress, Ingress []int
	RunTimeMs       float64
}

type Model

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

func (*Model) Close

func (m *Model) Close() error

func (*Model) EdgeCount

func (m *Model) EdgeCount() (int, error)

func (*Model) GetStations

func (m *Model) GetStations() ([]Coord, error)

func (*Model) JourneyQuery

func (m *Model) JourneyQuery(src, dst Circle) (*JourneyData, error)

func (*Model) MemoryUsageHuman

func (m *Model) MemoryUsageHuman() (string, error)

func (*Model) StationCount

func (m *Model) StationCount() (int, error)

func (*Model) TripCount

func (m *Model) TripCount() (int, error)

func (*Model) Vitals

func (m *Model) Vitals() (*Vitals, error)

type ModelPool

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

A ModelPool is used to create cheap Model structs used per request.

func NewModelPool

func NewModelPool(address string) (*ModelPool, error)

func (*ModelPool) Close

func (mp *ModelPool) Close() error

func (*ModelPool) Get

func (mp *ModelPool) Get() *Model

Returns a new Model to be used by a request. Close() should be called on the Model before the request ends.

type Vitals

type Vitals struct {
	TripCount, StationCount, EdgeCount int
	MemoryUsageHuman                   string
}

Jump to

Keyboard shortcuts

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