events

package
v0.0.0-...-4b21e95 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAvailability

func FindAvailability(event types.Event) []types.TimePair

func GetAvailability

func GetAvailability(eventProvider db.EventProvider) http.HandlerFunc

func GetVoteOptions

func GetVoteOptions(eventProvider db.EventProvider) http.HandlerFunc

gets the current events voting options

func ManageEvent

func ManageEvent(eventProvider db.EventProvider, discordSession *discordgo.Session, eventID string)

ManageEvent manages an event after it has been populated

func PopulateEvent

func PopulateEvent(eventProvider db.EventProvider, discordSession *discordgo.Session) http.HandlerFunc

need to confirm that the user who is populating the event is the same as the user who created the event

func PostVotes

func PostVotes(eventProvider db.EventProvider) http.HandlerFunc

need to confirm that who is putting is in the Guild and has not already voted

func PutAvailability

func PutAvailability(eventProvider db.EventProvider) http.HandlerFunc

func Restart

func Restart(eventProvider db.EventProvider, discordSession *discordgo.Session)

upon restart of the application, need to restart all in progress events get all events from the database for each event, check if it is in progress (compare the last time to current time and is populated) if it is in progress, then restart it (call ManageEvent), else remove it

func Routes

func Routes(database db.Provider, discordSession *discordgo.Session) *chi.Mux

Types

type GetVoteOptionsLocation

type GetVoteOptionsLocation struct {
	Name                    string  `json:"name"`
	Stars                   float64 `json:"stars"`
	DistanceFromCurrentUser float64 `json:"distanceFromCurrentUser"`
	PreviewImageURL         string  `json:"previewImageUrl"`
	Address                 string  `json:"address"`
}

type GetVoteOptionsResponseBody

type GetVoteOptionsResponseBody struct {
	Times     []GetVoteOptionsTime     `json:"times"`
	Locations []GetVoteOptionsLocation `json:"locations"`
}

type GetVoteOptionsTime

type GetVoteOptionsTime struct {
	Start time.Time    `json:"start"`
	End   time.Time    `json:"end"`
	Users []types.User `json:"users"`
}

Jump to

Keyboard shortcuts

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