Documentation ¶
Index ¶
- type Client
- type DestsClient
- func (c *DestsClient) Generate(ctx context.Context, opts eventdb.DestGenerateRequest) (eventdb.DestGenerateReply, error)
- func (c *DestsClient) Get(ctx context.Context, id eventdb.DestID) (eventdb.Dest, error)
- func (c *DestsClient) List(ctx context.Context, id eventdb.DestID, update eventdb.DestUpdate) ([]eventdb.Dest, error)
- func (c *DestsClient) Update(ctx context.Context, id eventdb.DestID, update eventdb.DestUpdate) (eventdb.Dest, error)
- type EventsClient
- type UsersClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // HTTP is the underlying HTTP client used send requests. HTTP *http.Client // BaseURL is the HTTP endpoint for the REST API. Can be overridden for tests. // It defaults to https://backend.findrandomevents.com BaseURL string // JWT is the user credential used to authenticate with eventdb. // // We're using Firebase auth, so this must be retrieved from the Firebase API. JWT string Users *UsersClient Events *EventsClient Dests *DestsClient }
Client provides a client to eventdb's REST API.
Don't construct a Client directly. Use New() instead.
type DestsClient ¶
type DestsClient struct {
// contains filtered or unexported fields
}
DestsClient provides access to the eventdb /dests endpoint
func (*DestsClient) Generate ¶
func (c *DestsClient) Generate(ctx context.Context, opts eventdb.DestGenerateRequest) (eventdb.DestGenerateReply, error)
Generate 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.
type EventsClient ¶
type EventsClient struct {
// contains filtered or unexported fields
}
EventsClient provides access to the eventdb /events endpoint
func (*EventsClient) Search ¶
func (c *EventsClient) Search(ctx context.Context, req eventdb.EventSearchRequest) ([]eventdb.Event, error)
Search queries the database for events matching the EventSearchRequest and returns Event objects for the matching results.
func (*EventsClient) Submit ¶
func (c *EventsClient) Submit(ctx context.Context, req eventdb.EventSubmitRequest) error
Submit 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.
type UsersClient ¶
type UsersClient struct {
// contains filtered or unexported fields
}
UsersClient provides access to the eventdb /users endpoint