web

package
v0.0.0-...-c0093cc Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapContext

func BootstrapContext(app *firebase.App, db *sql.DB, bggCache *background.GameCache) gin.HandlerFunc

func GenconEndDate

func GenconEndDate(year int) string

func GenconStartDate

func GenconStartDate(year int) string

func GetTemplateFunctions

func GetTemplateFunctions(cache *background.GameCache) template.FuncMap

func KeyByBggYear

func KeyByBggYear(g *postgres.EventGroup, context *Context) (majorGroup, minorGroup string)

func KeyByCategoryOrg

func KeyByCategoryOrg(g *postgres.EventGroup, context *Context) (majorGroup, minorGroup string)

func KeyByCategorySystem

func KeyByCategorySystem(g *postgres.EventGroup, context *Context) (majorGroup, minorGroup string)

func LegacyCSRFMiddleware

func LegacyCSRFMiddleware() gin.HandlerFunc

func PartitionGroups

func PartitionGroups(
	groups []*postgres.EventGroup,
	context *Context,
	params QueryParams,
) ([]string, map[string][]string, map[string]map[string][]*postgres.EventGroup)

func ServeV2

func ServeV2(db *sql.DB, cache *background.GameCache) gin.HandlerFunc

ServeV2 returns a handler that serves the new UI (v2). It specifically intercepts event routes to inject dynamic Open Graph meta tags for better social media previews (Slack, Twitter, etc.).

Types

type Context

type Context struct {
	Year        int
	DisplayName string
	Email       string
	Starred     *postgres.UserStarredEvents
	User        *postgres.User
	Firebase    FirebaseConfig
	BggCache    *background.GameCache
}

type EventKeyFunc

type EventKeyFunc func(*postgres.EventGroup, *Context) (string, string)

type FirebaseConfig

type FirebaseConfig struct {
	ApiKey            string
	AuthDomain        string
	DatabaseURL       string
	MessagingSenderId string
	ProjectId         string
	StorageBucket     string
}

type LookupResult

type LookupResult struct {
	MainEvent    *events.GenconEvent
	EventsPerDay map[string][]*events.GenconEvent
	TotalTickets int
}

type QueryParams

type QueryParams struct {
	Year            int
	Days            map[string]bool
	StartBeforeHour int
	StartAfterHour  int
	EndBeforeHour   int
	EndAfterHour    int
	Grouping        EventKeyFunc
	SortAsc         bool
	Query           string
	OrgId           int
	Category        string
}

Jump to

Keyboard shortcuts

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