Documentation ¶
Index ¶
- type LdapService
- type MongoDatastore
- func (ds *MongoDatastore) GetAllEvents() ([]models.EventDetails, error)
- func (ds *MongoDatastore) GetAllPastEvents() ([]models.EventDetails, error)
- func (ds *MongoDatastore) GetAllPastEventsForSocID(socID int) ([]models.EventDetails, error)
- func (ds *MongoDatastore) GetAllSocieties() (map[string]models.Society, error)
- func (ds *MongoDatastore) GetAllUpcomingEvents() ([]models.EventDetails, error)
- func (ds *MongoDatastore) GetAllUpcomingEventsForSocID(socID int) ([]models.EventDetails, error)
- func (ds *MongoDatastore) GetSocietyBySocietyName(societyName string) (*models.Society, error)
- func (ds *MongoDatastore) UpsertEvents(events []models.EventDetails) error
- func (ds *MongoDatastore) UpsertSociety(society models.Society) error
- type SchedulerService
- type SocietiesPortalService
- func (s *SocietiesPortalService) GetAllEvents(onlyUpcomingEvents bool) ([]models.Event, error)
- func (s *SocietiesPortalService) GetAllEventsDetails(eventDetailIDs []int) (map[int]models.EventDetails, error)
- func (s *SocietiesPortalService) GetEventsForSocID(socID string) ([]models.Event, error)
- func (s *SocietiesPortalService) GetMemberFromSocietiesPortal(memberID string) (*models.SocietyMember, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LdapService ¶
type LdapService struct { Conn *ldap.Conn Bind string Password string UserSearchBase string SocietySearchBase string GroupSearchBase string SearchBase string }
func NewLdap ¶
func NewLdap(config *config.Config) *LdapService
type MongoDatastore ¶
func NewDatastore ¶
func NewDatastore(config *config.Config) *MongoDatastore
func (*MongoDatastore) GetAllEvents ¶
func (ds *MongoDatastore) GetAllEvents() ([]models.EventDetails, error)
func (*MongoDatastore) GetAllPastEvents ¶
func (ds *MongoDatastore) GetAllPastEvents() ([]models.EventDetails, error)
func (*MongoDatastore) GetAllPastEventsForSocID ¶
func (ds *MongoDatastore) GetAllPastEventsForSocID(socID int) ([]models.EventDetails, error)
func (*MongoDatastore) GetAllSocieties ¶
func (ds *MongoDatastore) GetAllSocieties() (map[string]models.Society, error)
func (*MongoDatastore) GetAllUpcomingEvents ¶
func (ds *MongoDatastore) GetAllUpcomingEvents() ([]models.EventDetails, error)
func (*MongoDatastore) GetAllUpcomingEventsForSocID ¶
func (ds *MongoDatastore) GetAllUpcomingEventsForSocID(socID int) ([]models.EventDetails, error)
TODO Theres a bug in here somewhere relating to recent (within an hour) events not showing up
func (*MongoDatastore) GetSocietyBySocietyName ¶
func (ds *MongoDatastore) GetSocietyBySocietyName(societyName string) (*models.Society, error)
func (*MongoDatastore) UpsertEvents ¶
func (ds *MongoDatastore) UpsertEvents(events []models.EventDetails) error
* Event Database Helpers
func (*MongoDatastore) UpsertSociety ¶
func (ds *MongoDatastore) UpsertSociety(society models.Society) error
* Society Database Helpers
type SchedulerService ¶
type SchedulerService struct { Config *config.Config Datastore *MongoDatastore Scheduler *gocron.Scheduler }
func NewSchedulerService ¶
func NewSchedulerService(config *config.Config) *SchedulerService
func (*SchedulerService) DoGetAllEvents ¶
func (s *SchedulerService) DoGetAllEvents()
func (*SchedulerService) RunAllServices ¶
func (s *SchedulerService) RunAllServices()
type SocietiesPortalService ¶
type SocietiesPortalService struct { Datastore *MongoDatastore WebservicesEndpoint string AjaxEndpoint string WebservicesUsername string WebservicesPassword string WebservicesMemberServiceMethodIndividual string WebservicesMemberServiceMethodAll string WebservicesMemberServiceSearchByOption string EventService string EventServiceMethodAll string EventServiceMethodIndividual string EventServiceAction string }
func NewSocietiesPortalService ¶
func NewSocietiesPortalService(config *config.Config, datastore *MongoDatastore) *SocietiesPortalService
func (*SocietiesPortalService) GetAllEvents ¶
func (s *SocietiesPortalService) GetAllEvents(onlyUpcomingEvents bool) ([]models.Event, error)
func (*SocietiesPortalService) GetAllEventsDetails ¶
func (s *SocietiesPortalService) GetAllEventsDetails(eventDetailIDs []int) (map[int]models.EventDetails, error)
Here we're gettings the eventDetailsIDs and contacting the Socs Poral to get details on every event. The idea then is to save them to the database so we're not annoying Socs Portal every time we want to find out about our events.
func (*SocietiesPortalService) GetEventsForSocID ¶
func (s *SocietiesPortalService) GetEventsForSocID(socID string) ([]models.Event, error)
This contacts the Socs Portal to get the list of past and upcoming events. We then have no use for the rest of the data as it doesn't give us enough details anyways. So we've to contact the Socs Portal again on a seperate API for every eventID we get. This function just returns an array of eventDetailsIDs as strings.
func (*SocietiesPortalService) GetMemberFromSocietiesPortal ¶
func (s *SocietiesPortalService) GetMemberFromSocietiesPortal(memberID string) (*models.SocietyMember, error)