court_reserver_interface

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CourtReserver

type CourtReserver interface {
	BookNow(time_zone *time.Location, reservation *Reservation, captcha_solver captcha_solver.CaptchaSolver, payment_passwd *string) ReservationStatus
}

type Reservation

type Reservation struct {
	Date time.Time
	Site Site
	// book ONLY the top book available
	Preferences []SingleBook
	Priority    int // lower priority value would try to book first.
}

type ReservationStatus

type ReservationStatus struct {
	Code      ReservationStatusCode
	Msg       string
	CourtTime map[string]string // time -> court
}

type ReservationStatusCode

type ReservationStatusCode int
const (
	Pending ReservationStatusCode = iota
	Success
	NeedPayment
	Failed
	NeedAuthorization
)

type SingleBook

type SingleBook struct {
	// book all contiguous courts COVERINGs Date + StartTime to Date + StartTime + Duration. Time starts with UTC.
	StartTime time.Duration
	Duration  time.Duration
	// preferring booking name
	CourtNamePreference []string
}

type Site

type Site int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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