Documentation ¶
Index ¶
- func ActivateCurator(userID int, db *sql.DB) error
- func ComputeIntervalForUser(userID int, n int, baseInterval int, db *sql.DB) (time.Duration, error)
- func DeactivateCurator(userID int, db *sql.DB) error
- func GetAllActiveCurstorsChatID(db *sql.DB) ([]int64, error)
- func GetAllActiveCurstorsID(db *sql.DB) ([]int, error)
- func GetLastReportDate(db *sql.DB) (lastReportDate time.Time)
- func GetLastRewardDate(db *sql.DB) (lastReportDate time.Time)
- func GetNumResponsesForMotivation(date time.Time, db *sql.DB) (num int)
- func GetNumResponsesForMotivationForUserID(userID int, date time.Time, db *sql.DB) (num int)
- func GetNumResponsesVoteID(voteID int64, db *sql.DB) (int, int)
- func GetOpenedVotesCount(db *sql.DB) (count int)
- func GetUserIDsForMotivation(date time.Time, db *sql.DB) (userIDs []int, err error)
- func IsActiveCredential(userID int, db *sql.DB) bool
- func IsActiveCurator(userID int, db *sql.DB) bool
- func IsReferralExists(referral string, db *sql.DB) bool
- func NewReportPosted(db *sql.DB) (int64, error)
- func NewRewardDistributed(db *sql.DB) (int64, error)
- func WannaSleepOneDay(hour, min int) (sleepTime time.Duration)
- func WannaSleepTill(weekday time.Weekday, hour, min int) (sleepTime time.Duration)
- type Credential
- type Referral
- type Response
- type State
- type Vote
- func GetAllOpenedVotes(db *sql.DB) (votes []Vote, err error)
- func GetLastVoteForUserID(userID int, db *sql.DB) (vote Vote)
- func GetLastVotesForUserID(userID int, num int, db *sql.DB) (votes []Vote, err error)
- func GetTrulyCompletedVotesSince(date time.Time, db *sql.DB) (votes []Vote, err error)
- func GetVote(db *sql.DB, voteID int64) (vote Vote)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeIntervalForUser ¶
computes interval based on last n posts
func GetOpenedVotesCount ¶
func GetUserIDsForMotivation ¶
func WannaSleepOneDay ¶
Types ¶
type Credential ¶
type Credential struct { UserID int ChatID int64 UserName string Power int Active bool Curates bool }
func GetAllActiveCredentials ¶
func GetAllActiveCredentials(db *sql.DB) (credentials []Credential, err error)
func GetCredentialByUserID ¶
func GetCredentialByUserID(userID int, db *sql.DB) (credential Credential, err error)
func GetCredentialByUserName ¶
func GetCredentialByUserName(userName string, db *sql.DB) (credential Credential, err error)
func (Credential) UpdatePower ¶
func (credential Credential) UpdatePower(power int, db *sql.DB) error
type Referral ¶
func GetReferralByUserID ¶
type Response ¶
Click to show internal directories.
Click to hide internal directories.