Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { ID string `json:"id"` Source string `json:"source"` Title string `json:"title"` Description string `json:"description"` Location EventLocation `json:"location"` StartTime string `json:"start_date_time"` EndTime string `json:"end_date_time"` Organizer string `json:"organizer"` Pricing string `json:"pricing"` Url string `json:"url"` Interests []string `json:"interests"` }
type EventHandler ¶
type EventHandler struct { Config *configuration.Config Store *EventStore }
func NewEventHandler ¶
func NewEventHandler(config *configuration.Config, store *EventStore) *EventHandler
func (*EventHandler) GetAllEvents ¶
func (h *EventHandler) GetAllEvents(w http.ResponseWriter, r *http.Request)
func (*EventHandler) GetEvent ¶
func (h *EventHandler) GetEvent(w http.ResponseWriter, r *http.Request)
func (*EventHandler) PostEvent ¶
func (h *EventHandler) PostEvent(w http.ResponseWriter, r *http.Request)
type EventInsertError ¶
type EventInsertError string
var ( ErrEventAlreadyExists EventInsertError = "Event already exists" ErrGeneralInsertError EventInsertError = "General insert error" )
type EventLocation ¶
type EventMatches ¶
type EventStore ¶
type EventStore struct { Config *configuration.Config Events []Event `json:"events"` }
func NewEventStore ¶
func NewEventStore(config *configuration.Config) (*EventStore, error)
func (*EventStore) InsertEvent ¶
func (s *EventStore) InsertEvent(event Event) (*Event, *EventInsertError)
func (*EventStore) ReadAllEvents ¶
func (s *EventStore) ReadAllEvents() ([]Event, error)
func (*EventStore) SaveDataToJsonFile ¶
func (s *EventStore) SaveDataToJsonFile() error
Click to show internal directories.
Click to hide internal directories.