util

package
v0.0.0-...-3c2b775 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JapanTime = time.FixedZone("UTC+9", +9*60*60)

Functions

func EnglishPriceHandler

func EnglishPriceHandler(p string) (price string)

func FindPrice

func FindPrice(arr []string) string

func FindTime

func FindTime(s string, prefix string) string

func GetDate

func GetDate(md []rune, sep rune) (month string, day string, err error)

func GetJSON

func GetJSON(url string, target interface{}) error

func GetRelevantYear

func GetRelevantYear(month int) int

GetRelevantYear gets the year for a given month. Some connectors have no way to get the year from DOM, so we make a basic set of assumptions:

1. If the month of the live is equal to or greater than the current month, assume the live is in the current year.

2. If the month of the live is less than the current month, assume the live is next year.

func GetTimeFromString

func GetTimeFromString(s string) (hour string, minute string, nextDay bool)

func GetUniqueVenueIDs

func GetUniqueVenueIDs(a []datastructures.LiveHouse) (b []string)

func GetUniqueVenues

func GetUniqueVenues(a []datastructures.LiveHouse) (b []datastructures.LiveHouse)

func GetYearMonth

func GetYearMonth(ym []rune, sep rune) (year string, month string, err error)

func GetYearMonthDay

func GetYearMonthDay(ymd []rune, sep1 rune, sep2 rune) (year string, month string, day string, err error)

func InsertShortYearMonth

func InsertShortYearMonth(s string) string

func InsertYearMonth

func InsertYearMonth(s string) string

func ParseForm

func ParseForm(r *http.Request, v any) *logging.StatusError

func ParseTime

func ParseTime(d string, t string) (res time.Time, err error)

func Pointer

func Pointer[T any](v T) *T

func ProcessArtists

func ProcessArtists(a []string) (artists []string)

func SpacedPriceTimeFetcher

func SpacedPriceTimeFetcher(d string, s string) (price string, open time.Time, start time.Time, err error)

Types

type ConnectorTestErrorCreator

type ConnectorTestErrorCreator struct {
	T    *testing.T
	Chan chan ConnectorTestResult
	Name string
}

func (ConnectorTestErrorCreator) Error

func (c ConnectorTestErrorCreator) Error(err any)

func (ConnectorTestErrorCreator) Errorf

func (c ConnectorTestErrorCreator) Errorf(format string, args ...any)

func (ConnectorTestErrorCreator) Succeed

func (c ConnectorTestErrorCreator) Succeed()

type ConnectorTestResult

type ConnectorTestResult struct {
	Name string
	Err  string
}

type ConnectorTestResults

type ConnectorTestResults []ConnectorTestResult

func (ConnectorTestResults) String

func (testResults ConnectorTestResults) String() string

type PriceHandler

type PriceHandler func(p string) (price string, err error)

type TimeHandler

type TimeHandler func(d string, t string) (open int, start int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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