iface

package
v0.0.0-...-ad80e31 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Line = func(d1, d2 *Departure) bool {
		return d1.Line < d2.Line
	}
	Destination = func(d1, d2 *Departure) bool {
		return d1.Destination < d2.Destination
	}
	Eta = func(d1, d2 *Departure) bool {
		return d1.EtaNanoSec < d2.EtaNanoSec
	}
	EtaDesc = func(d1, d2 *Departure) bool {
		return Eta(d2, d1)
	}
)
View Source
var (
	AllBackends  = make(map[string]Backend)
	AllFrontends = make(map[string]Frontend)
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Setup()
	GetDepartures(station string) []Departure
}

type By

type By func(d1, d2 *Departure) bool

func (By) Sort

func (by By) Sort(deps []Departure)

Sorting stuff totaly stolen from pkg sort documentation. Use like this:

By(Eta).Sort(departures)

type Departure

type Departure struct {
	Line        string
	Destination string
	EtaNanoSec  time.Duration
	Issues      []string
}

type Frontend

type Frontend interface {
	Setup()
	RenderDepartures(station string, deps []Departure)
}

Jump to

Keyboard shortcuts

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