events

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(city, addr, date, tiime, desc, org, link, uid string) (string, error)

Create creates a new event in the database. It also do some formatting operations on some values such as the date and time to convert them to a common and parsable format

func Delete

func Delete(id string) error

Delete deletes an event from the database

func GetCitiesWithEvents

func GetCitiesWithEvents() ([]string, error)

GetCitiesWithEvents returns a slice of strings which contains cities that are in the database, meaning cities with future, present or past events

func GetEventCreatorID

func GetEventCreatorID(id string) (string, error)

GetEventCreatorID returns the created_by field associated to an event id

func GetNumOfEvents

func GetNumOfEvents() (int, error)

GetNumOfEvents returns the total number of events in the database

func Update

func Update(id string, event Event) error

Update updates an event based on its ID

Types

type Event

type Event struct {
	City        string
	Address     string
	Date        string
	Time        string
	Description string
	Organizer   string
	Link        string
	MapLink     string
	ID          string
	CreatedBy   string
}

func GetAllEvents

func GetAllEvents() ([]Event, error)

func GetEventByID

func GetEventByID(id string, translate bool) (Event, error)

GetEventByID returns a single event from the database identified by its ID. We also need to specify if we want to translate the date in french or not

func GetEventsByCityOrdered

func GetEventsByCityOrdered(city string) ([]Event, error)

GetEventsByCityOrdered retuns a list of events for a given city. Those events are ordered chronologically

func GetEventsByUserID

func GetEventsByUserID(id string) ([]Event, error)

GetEventsByUserID returns a list of events created by a user, identified by its user ID, called 'created_by' in the database

Jump to

Keyboard shortcuts

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