Documentation ¶
Index ¶
- type Provider
- func (p *Provider) Connect(ctx context.Context) error
- func (p *Provider) CreatePartial(ctx context.Context, event types.Event) error
- func (p *Provider) Disconnect(ctx context.Context) error
- func (p *Provider) GetAllEvents(ctx context.Context) ([]*types.Event, error)
- func (p *Provider) GetEvent(ctx context.Context, id string) (*types.Event, error)
- func (p *Provider) GetSingle(ctx context.Context, eventID string) (*types.Event, error)
- func (p *Provider) PopulateEvent(ctx context.Context, event types.Event, userID string) error
- func (p *Provider) PostVotes(ctx context.Context, userID string, votes types.UserVotes, eventID string) error
- func (p *Provider) PutUserAvailabilityAndLocation(ctx context.Context, userID string, availability types.UserAvailability, ...) error
- func (p *Provider) UpdateVoteOptions(ctx context.Context, voteOptions types.VoteOption, eventID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements the Provider interface for a MongoDB connection
func NewProvider ¶
NewProvider creates a new provider and loads values in from the environment
func (*Provider) Connect ¶
Connect connects to the MongoDB server and creates any indices as necessary
func (*Provider) CreatePartial ¶
func (*Provider) Disconnect ¶
Disconnect terminates the connection to the MongoDB server
func (*Provider) GetAllEvents ¶
func (*Provider) PopulateEvent ¶
Update updates an existing event Ignore the following fields: - creatorID - guildID - channelID - populated - voteOptions - userVotes - userAvailability - userLocations - userVotes
func (*Provider) PostVotes ¶
func (p *Provider) PostVotes(ctx context.Context, userID string, votes types.UserVotes, eventID string) error
Update updates an existing event
func (*Provider) PutUserAvailabilityAndLocation ¶
func (p *Provider) PutUserAvailabilityAndLocation(ctx context.Context, userID string, availability types.UserAvailability, location types.UserLocation, eventID string) error
func (*Provider) UpdateVoteOptions ¶
Click to show internal directories.
Click to hide internal directories.