service

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: NCSA Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PreEventCheckinIntervalInMinutes = 15
View Source
const PreEventCheckinIntervalInSeconds = PreEventCheckinIntervalInMinutes * 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(id string, event models.Event) error

Creates an event with the given id

func DeleteEvent

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

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 GetAllEvents

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

Returns all the events

func GetEvent

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

Returns the event with the given id

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 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 Initialize added in v0.3.0

func Initialize() error

func IsEventActive

func IsEventActive(event_id 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 the current time is between `PreEventCheckinIntervalInMinutes` number of minutes before the event, and the end of event.

func IsUserAttendingEvent

func IsUserAttendingEvent(event_id 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_id 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(id string, event models.Event) error

Updates the event with the given id

Types

This section is empty.

Jump to

Keyboard shortcuts

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