Documentation ¶
Index ¶
- func AddEvent(newEvent *Event) error
- func AddRegistration(r *Registration) error
- func AddUser(u *User) error
- func CancelRegistration(r Registration) (bool, error)
- func CheckIfUserRegisteredForEvent(userID, eventID int) (bool, error)
- func CheckIfUserRegisteredForEventByMongoID(mongoID string, eventID int) (bool, error)
- func CheckUserHash(email, password string) bool
- func DeleteEvent(eventID int) error
- func Login(email, password string) (interface{}, error)
- func UpdateEvent(updateEvent *Event) error
- type Event
- type Registration
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRegistration ¶
func AddRegistration(r *Registration) error
AddRegistration adds a registration into the db
func CancelRegistration ¶
func CancelRegistration(r Registration) (bool, error)
CancelRegistration cancels a registration of an event
func CheckIfUserRegisteredForEvent ¶
CheckIfUserRegisteredForEvent checks if the user registered for a particular event
func CheckIfUserRegisteredForEventByMongoID ¶
CheckIfUserRegisteredForEventByMongoID checks if the user registered for the event using Mongo Object ID
func CheckUserHash ¶
CheckUserHash checks if the given combination of email and password exists in the db
func Login ¶
Login checks if a user combination is present in the database. If yes, returns the user object, or else returns a nil
func UpdateEvent ¶
UpdateEvent updates an event in the db
Types ¶
type Event ¶
type Event struct { EventName string `json:"name"` EventID int `bson:"id" json:"id"` Fee int `json:"fee"` TeamSize int `json:"teamsize"` Category string `json:"category"` Day int `json:"day"` StartTime int `json:"start"` EndTime int `json:"end"` Description string `json:"description"` ImageUrl string `json:"url"` }
func FindAllEvents ¶
FindAllEvents returns all events in the fest db
func FindEventByID ¶
FindEventByID finds an event given its id
func GetEventsOfUser ¶
GetEventsOfUser returns all the events registered by a user
type Registration ¶
type Registration struct { EventID int `bson:"eventid" json:"eventid"` UserID int `bson:"userid" json:"userid"` RegID string `bson:"regid" json:"regid"` }
Registration contains the record of user registered for a particular event
type User ¶
type User struct { FirstName string `bson:"fname" json:"fname"` LastName string `bson:"lname" json:"lname"` Gender string `bson:"gender" json:"gender"` PhoneNumber string `bson:"number" json:"number"` EmailAddress string `bson:"email" json:"email"` CollegeName string `bson:"college" json:"college"` Password string `bson:"pwd" json:",omitempty"` UserID int `bson:"userid" json:"userid"` SamID string `bson:"samid" json:"samid"` }
User is the structure of how a User looks
func GetAllUsers ¶
GetAllUsers returns all the users registered for the fest
func GetUserByID ¶
GetUserByID returns the users given the userid
func GetUsersForEvent ¶
GetUsersForEvent returns all the users registered for a single event