service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2019 License: NCSA Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PreEventCheckinIntervalInSeconds = 15 * 60

Variables

This section is empty.

Functions

func AddEventFavorite

func AddEventFavorite(id string, event string) error

Adds the given event to the favorites for the user with the given id

func CreateEvent

func CreateEvent(name string, event models.Event) error

Creates an event with the given name

func DeleteEvent

func DeleteEvent(name string) (*models.Event, error)

Deletes the event with the given name. Removes the event from event trackers and every user's tracker. Returns the event that was deleted.

func GetAllEvents

func GetAllEvents() (*models.EventList, error)

Returns all the events

func GetEvent

func GetEvent(name string) (*models.Event, error)

Returns the event with the given name

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_name string) (*models.EventTracker, error)

Returns the event tracker for the specified event

func GetStats

func GetStats() (map[string]interface{}, error)

Returns all event stats

func GetUserTracker

func GetUserTracker(user_id string) (*models.UserTracker, error)

Returns the user tracker for the specified user

func IsEventActive

func IsEventActive(event_name string) (bool, error)

Check if an event is active, i.e., that check-ins are allowed for the event at the current time. Returns true if and only if abs(Current Time - Event Start Time) <= 1200 seconds (20 minutes).

func IsUserAttendingEvent

func IsUserAttendingEvent(event_name string, user_id string) (bool, error)

Returns true is the user has already been marked as attending the specified event, false otherwise

func IsUserCheckedIn

func IsUserCheckedIn(id string) (bool, error)

Checks if the user has been checked in with the checkin service

func MarkUserAsAttendingEvent

func MarkUserAsAttendingEvent(event_name string, user_id string) error

Marks the specified user as attending the specified event The user must not already marked as attending for this to return successfully

func RemoveEventFavorite

func RemoveEventFavorite(id string, event string) error

Removes the given event to the favorites for the user with the given id

func UpdateEvent

func UpdateEvent(name string, event models.Event) error

Updates the event with the given name

Types

This section is empty.

Jump to

Keyboard shortcuts

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