konturtransferbot

package module
v0.0.0-...-a5c5d53 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: BSD-2-Clause-Views Imports: 3 Imported by: 0

README

Build Status Coverage Status Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Departure

type Departure struct {
	time.Time
	Comment string
}

Departure is a single departure time

func (*Departure) UnmarshalJSON

func (d *Departure) UnmarshalJSON(departure []byte) error

UnmarshalJSON is a custom unmarshaler function for time, which works for both JSON and YAML

type Logger

type Logger interface {
	Log(...interface{}) error
}

Logger is a simple logging wrapper interface

type Route

type Route []Departure

Route is a sorted sequence of departure times

func (Route) String

func (r Route) String() string

func (Route) StringWithDivider

func (r Route) StringWithDivider(now time.Time) string

StringWithDivider prints current time inside a route schedule

type Schedule

type Schedule struct {
	WorkDayRouteToOffice    Route
	WorkDayRouteFromOffice  Route
	SaturdayRouteToOffice   Route
	SaturdayRouteFromOffice Route
}

Schedule contains all information on transfer departure times

func (Schedule) GetFromOfficeText

func (s Schedule) GetFromOfficeText(now time.Time) (string, string)

GetFromOfficeText returns text representation of full schedule from office

func (Schedule) GetToOfficeText

func (s Schedule) GetToOfficeText(now time.Time) (string, string)

GetToOfficeText returns text representation of full schedule to office

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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