database

package
v0.0.0-...-1e14abc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore struct {
	DB *gorm.DB
}

func New

func New() *Datastore

func (*Datastore) AddOrUpdateGroup

func (store *Datastore) AddOrUpdateGroup(groupChatId int64, latestPollId int) tgbotapi.Chattable

func (*Datastore) AddParticipant

func (store *Datastore) AddParticipant(groupChatId int64, userId int, firstName string, lastName string) bool

AddParticipant adds a new participant to the database or reactivates an already existing participant. If it's a new participants, their counter is set to the current minimum of the other counters.

func (*Datastore) DeactivateGroup

func (store *Datastore) DeactivateGroup(groupChatId int64)

func (*Datastore) GetAllGroups

func (store *Datastore) GetAllGroups() []models.Group

func (*Datastore) GetAllParticipantsWithoutName

func (store *Datastore) GetAllParticipantsWithoutName() []models.Participant

func (*Datastore) GetNRandomParticipants

func (store *Datastore) GetNRandomParticipants(groupChatId int64, numberOfPeople int) ([]models.Participant, error)

func (*Datastore) GetParticipants

func (store *Datastore) GetParticipants(groupChatId int64) []models.Participant

func (*Datastore) RemoveParticipant

func (store *Datastore) RemoveParticipant(groupChatId int64, userId int) bool

func (*Datastore) ResetGroup

func (store *Datastore) ResetGroup(groupChatId int64)

func (*Datastore) SetNameOfParticipant

func (store *Datastore) SetNameOfParticipant(userID int, firstName string, lastName string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL