model

package
v0.0.0-...-95527fa Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type General

type General struct {
	UserID  string
	Role    string
	Message string
}

General general info for all templates

func MakeGeneral

func MakeGeneral(params ...string) (gen General)

MakeGeneral gives a general obj

type Menu struct {
	Gen     General
	Options []Option
}

Menu place holder for menu objects

func MakeMainMenu

func MakeMainMenu(gen General) (menu Menu)

MakeMainMenu the main menu

type Option

type Option struct {
	Function string
	Name     string
}

Option place holder for each Option item

type Result

type Result struct {
	ChartID      string
	TrainNumber  int
	TrainName    string
	FromTime     string
	ToTime       string
	JourneyTime  string
	Availability int
}

Result result

type Search struct {
	Gen              General
	Stations         []string
	MinDate          string // in the format "yyyy-mm-dd"
	Results          []Result
	AllowReservation string
	From             string
	To               string
}

Search search

func MakeSearch

func MakeSearch(gen General) (s Search)

MakeSearch make search form page

func (*Search) AddResult

func (s *Search) AddResult(r Result)

AddResult adds result row

Jump to

Keyboard shortcuts

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