Documentation ¶
Index ¶
- Constants
- func AddEventFavorite(id string, event string) error
- func CreateEvent(id string, event models.Event) error
- func DeleteEvent(id string) (*models.Event, error)
- func GetAllEvents() (*models.EventList, error)
- func GetEvent(id string) (*models.Event, error)
- func GetEventFavorites(id string) (*models.EventFavorites, error)
- func GetEventTracker(event_id string) (*models.EventTracker, error)
- func GetStats() (map[string]interface{}, error)
- func GetUserTracker(user_id string) (*models.UserTracker, error)
- func Initialize() error
- func IsEventActive(event_id string) (bool, error)
- func IsUserAttendingEvent(event_id string, user_id string) (bool, error)
- func IsUserCheckedIn(id string) (bool, error)
- func MarkUserAsAttendingEvent(event_id string, user_id string) error
- func RemoveEventFavorite(id string, event string) error
- func UpdateEvent(id string, event models.Event) error
Constants ¶
const PreEventCheckinIntervalInMinutes = 15
const PreEventCheckinIntervalInSeconds = PreEventCheckinIntervalInMinutes * 60
Variables ¶
This section is empty.
Functions ¶
func AddEventFavorite ¶
Adds the given event to the favorites for the user with the given id
func CreateEvent ¶
Creates an event with the given id
func DeleteEvent ¶
Deletes the event with the given id. Removes the event from event trackers and every user's tracker. Returns the event that was deleted.
func GetEventFavorites ¶
func GetEventFavorites(id string) (*models.EventFavorites, error)
Returns the event favorites for the user with the given id
func GetEventTracker ¶
func GetEventTracker(event_id string) (*models.EventTracker, error)
Returns the event tracker for the specified event
func GetUserTracker ¶
func GetUserTracker(user_id string) (*models.UserTracker, error)
Returns the user tracker for the specified user
func Initialize ¶ added in v0.3.0
func Initialize() error
func IsEventActive ¶
Check if an event is active, i.e., that check-ins are allowed for the event at the current time. Returns true if the current time is between `PreEventCheckinIntervalInMinutes` number of minutes before the event, and the end of event.
func IsUserAttendingEvent ¶
Returns true is the user has already been marked as attending the specified event, false otherwise
func IsUserCheckedIn ¶
Checks if the user has been checked in with the checkin service
func MarkUserAsAttendingEvent ¶
Marks the specified user as attending the specified event The user must not already marked as attending for this to return successfully
func RemoveEventFavorite ¶
Removes the given event to the favorites for the user with the given id
Types ¶
This section is empty.