Documentation ¶
Index ¶
- type FacebookClient
- type Service
- func (s *Service) DestGenerate(ctx context.Context, opts eventdb.DestGenerateRequest) (eventdb.DestGenerateReply, error)
- func (s *Service) DestGet(ctx context.Context, id eventdb.DestID) (eventdb.Dest, error)
- func (s *Service) DestList(ctx context.Context, opts eventdb.DestListRequest) ([]eventdb.Dest, error)
- func (s *Service) DestUpdate(ctx context.Context, id eventdb.DestID, update eventdb.DestUpdate) (eventdb.Dest, error)
- func (s *Service) EventGet(ctx context.Context, id eventdb.EventID) (eventdb.Event, error)
- func (s *Service) EventSearch(ctx context.Context, req eventdb.EventSearchRequest) ([]eventdb.Event, error)
- func (s *Service) EventSearchFull(ctx context.Context, params eventdb.EventSearchRequest) ([]json.RawMessage, error)
- func (s *Service) EventSubmit(ctx context.Context, req eventdb.EventSubmitRequest) error
- func (s *Service) UserGet(ctx context.Context, id eventdb.UserID) (eventdb.User, error)
- func (s *Service) UserUpdate(ctx context.Context, id eventdb.UserID, update eventdb.UserUpdate) (*eventdb.User, error)
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FacebookClient ¶
type FacebookClient interface {
GetEventInfo(ctx context.Context, ids []string) ([]json.RawMessage, error)
}
FacebookClient mocks out access to the Facebook Graph API.
type Service ¶
type Service struct { DestStore *pg.DestStore EventStore *pg.EventStore UserStore *pg.UserStore FacebookClient func(oauthToken string) FacebookClient Time Time Auth auth.Provider }
Service is a programmatic API to the eventdb. It manages access to the Store and checks permissions.
func (*Service) DestGenerate ¶
func (s *Service) DestGenerate(ctx context.Context, opts eventdb.DestGenerateRequest) (eventdb.DestGenerateReply, error)
DestGenerate finds a new random event near the user's location and returns a DestGenerateReply that includes the new event and whether or not the search was successful.
func (*Service) DestList ¶
func (s *Service) DestList(ctx context.Context, opts eventdb.DestListRequest) ([]eventdb.Dest, error)
DestList lists a user's Dests by creation date.
func (*Service) DestUpdate ¶
func (s *Service) DestUpdate(ctx context.Context, id eventdb.DestID, update eventdb.DestUpdate) (eventdb.Dest, error)
DestUpdate updates a Dest with the user's feedback
func (*Service) EventSearch ¶
func (s *Service) EventSearch(ctx context.Context, req eventdb.EventSearchRequest) ([]eventdb.Event, error)
EventSearch queries the database for events matching the EventSearchRequest and returns Event objects for the matching results.
func (*Service) EventSearchFull ¶
func (s *Service) EventSearchFull(ctx context.Context, params eventdb.EventSearchRequest) ([]json.RawMessage, error)
EventSearchFull queries the database for events matching the EventSearchRequest and returns the raw Graph API JSON data for the matching results.
func (*Service) EventSubmit ¶
EventSubmit downloads the events using the Facebook API and saves them to the EventStore. It uses a random user's Facebook API token to fetch the event so some users must be logged in with Facebook for this method to work.