Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v0.0.0-...-da0fb74 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSessionExpired = errors.New("session expired")

Functions

This section is empty.

Types

type CampfireToken

type CampfireToken struct {
	ID        int       `db:"campfire_token_id"`
	Token     string    `db:"campfire_token_token"`
	ExpiresAt time.Time `db:"campfire_token_expires_at"`
	Email     string    `db:"campfire_token_email"`
}

type Club

type Club struct {
	ID                           string          `db:"club_id"`
	Name                         string          `db:"club_name"`
	AvatarURL                    string          `db:"club_avatar_url"`
	CreatorID                    string          `db:"club_creator_id"`
	CreatedByCommunityAmbassador bool            `db:"club_created_by_community_ambassador"`
	ImportedAt                   time.Time       `db:"club_imported_at"`
	RawJSON                      json.RawMessage `db:"club_raw_json"`
	AutoEventImport              bool            `db:"club_auto_event_import"`
	ClubVerificationChannelID    *string         `db:"club_verification_channel_id"`
	LastAutoEventImportedAt      time.Time       `db:"club_last_auto_event_imported_at"`
}

type ClubImportJob

type ClubImportJob struct {
	ID          int                              `db:"club_import_job_id"`
	ClubID      string                           `db:"club_import_job_club_id"`
	CreatedAt   time.Time                        `db:"club_import_job_created_at"`
	CompletedAt time.Time                        `db:"club_import_job_completed_at"`
	LastTriedAt time.Time                        `db:"club_import_job_last_tried_at"`
	Status      ClubImportJobStatus              `db:"club_import_job_status"`
	State       xpgtype.JSON[ClubImportJobState] `db:"club_import_job_state"`
	Error       string                           `db:"club_import_job_error"`
}

type ClubImportJobState

type ClubImportJobState struct {
	Events       []EventState `json:"events"`
	EventCursor  *string      `json:"event_cursor"`
	Members      []Member     `json:"members"`
	MemberCursor *string      `json:"member_cursor"`
}

type ClubImportJobStatus

type ClubImportJobStatus string
const (
	ClubImportJobStatusPending   ClubImportJobStatus = "pending"
	ClubImportJobStatusCompleted ClubImportJobStatus = "completed"
	ClubImportJobStatusFailed    ClubImportJobStatus = "failed"
)

type ClubImportJobWithClub

type ClubImportJobWithClub struct {
	ClubImportJob
	Club
}

type ClubMemberCheckInCount

type ClubMemberCheckInCount struct {
	MemberID string `db:"member_id"`
	CheckIns int    `db:"check_ins"`
}

type ClubRef

type ClubRef struct {
	ID   string `db:"club_id"`
	Name string `db:"club_name"`
}

ClubRef is a lightweight club identifier used for dropdowns and pickers.

type ClubStatsEventRow

type ClubStatsEventRow struct {
	Event
	Accepted int `db:"accepted"`
	CheckIns int `db:"check_ins"`
	Declined int `db:"declined"`
	RSVPs    int `db:"rsvps"`
}

type ClubStatsMonthRow

type ClubStatsMonthRow struct {
	Month     string `db:"month"`
	Events    int    `db:"events"`
	CheckIns  int    `db:"check_ins"`
	RSVPs     int    `db:"rsvps"`
	NewPeople int    `db:"new_participants"`
}

type ClubStatsTotals

type ClubStatsTotals struct {
	Events             int       `db:"events"`
	UniqueParticipants int       `db:"unique_participants"`
	TotalRSVPs         int       `db:"total_rsvps"`
	TotalCheckIns      int       `db:"total_check_ins"`
	TotalAccepted      int       `db:"total_accepted"`
	TotalDeclined      int       `db:"total_declined"`
	FirstEventDate     time.Time `db:"first_event_date"`
	LastEventDate      time.Time `db:"last_event_date"`
}

type ClubWithCreator

type ClubWithCreator struct {
	Club
	Member
}

type ClubWithEvents

type ClubWithEvents struct {
	Club
	Events int `db:"events"`
}

type CodeRequest

type CodeRequest struct {
	ID        int       `db:"code_request_id"`
	CreatedAt time.Time `db:"code_request_created_at"`
}

type Config

type Config struct {
	Host     string `toml:"host"`
	Port     int    `toml:"port"`
	Username string `toml:"username"`
	Password string `toml:"password"`
	Database string `toml:"database"`
	SSLMode  string `toml:"ssl_mode"`
}

func (Config) DataSourceName

func (c Config) DataSourceName() string

func (Config) String

func (c Config) String() string

type Database

type Database struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*Database, error)

func (*Database) AddDiscordUserPinnedClub

func (d *Database) AddDiscordUserPinnedClub(ctx context.Context, userID, clubID string) error

func (*Database) AddDiscordUserRaffleBlockedMember

func (d *Database) AddDiscordUserRaffleBlockedMember(ctx context.Context, userID, memberID string) error

func (*Database) AppendRaffleEvents

func (d *Database) AppendRaffleEvents(ctx context.Context, raffleID int, eventIDs []string) error

func (*Database) BackfillEmptyEventCategories

func (d *Database) BackfillEmptyEventCategories(ctx context.Context) (int, error)

BackfillEmptyEventCategories sets event_category from the Campfire live event name for every event that still has an empty category. Returns the number of rows updated.

func (*Database) Close

func (d *Database) Close() error

func (*Database) ConfirmRaffleWinner

func (d *Database) ConfirmRaffleWinner(ctx context.Context, raffleID int, memberID string) error

func (*Database) CountEventsWithoutCategory

func (d *Database) CountEventsWithoutCategory(ctx context.Context) (int, error)

func (*Database) CreateSession

func (d *Database) CreateSession(ctx context.Context, session Session) error

func (*Database) DeleteEvent

func (d *Database) DeleteEvent(ctx context.Context, eventID string) error

func (*Database) DeleteExpiredCampfireTokens

func (d *Database) DeleteExpiredCampfireTokens(ctx context.Context) (int, error)

func (*Database) DeleteExpiredSessions

func (d *Database) DeleteExpiredSessions(ctx context.Context) error

func (*Database) DeleteNotConfirmedRaffleWinners

func (d *Database) DeleteNotConfirmedRaffleWinners(ctx context.Context, raffleID int) error

func (*Database) DeleteReward

func (d *Database) DeleteReward(ctx context.Context, codeID int) error

func (*Database) DeleteRewardCode

func (d *Database) DeleteRewardCode(ctx context.Context, id int) error

func (*Database) DeleteUnconfirmedRaffleWinners

func (d *Database) DeleteUnconfirmedRaffleWinners(ctx context.Context, raffleID int) error

func (*Database) GetAcceptedClubEventsByMember

func (d *Database) GetAcceptedClubEventsByMember(ctx context.Context, clubID string, memberID string) ([]Event, error)

func (*Database) GetAcceptedEventsByMember

func (d *Database) GetAcceptedEventsByMember(ctx context.Context, memberID string) ([]EventWithClub, error)

func (*Database) GetAcceptedMembersByEvent

func (d *Database) GetAcceptedMembersByEvent(ctx context.Context, eventID string) ([]Member, error)

func (*Database) GetAllEvents

func (d *Database) GetAllEvents(ctx context.Context) ([]Event, error)

func (*Database) GetBiggestCheckInEvent

func (d *Database) GetBiggestCheckInEvent(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool) (*EventWithCheckIns, error)

func (*Database) GetCampfireTokens

func (d *Database) GetCampfireTokens(ctx context.Context) ([]CampfireToken, error)

func (*Database) GetCampfireTokensExpiringSoon

func (d *Database) GetCampfireTokensExpiringSoon(ctx context.Context, within time.Duration) ([]CampfireToken, error)

func (*Database) GetCheckedInClubEventsByMember

func (d *Database) GetCheckedInClubEventsByMember(ctx context.Context, clubID string, memberID string) ([]Event, error)

func (*Database) GetCheckedInEventsByMember

func (d *Database) GetCheckedInEventsByMember(ctx context.Context, memberID string) ([]EventWithClub, error)

func (*Database) GetCheckedInMembersByEvent

func (d *Database) GetCheckedInMembersByEvent(ctx context.Context, eventID string) ([]Member, error)

func (*Database) GetClub

func (d *Database) GetClub(ctx context.Context, clubID string) (*ClubWithCreator, error)

func (*Database) GetClubEventCategories

func (d *Database) GetClubEventCategories(ctx context.Context, clubID string) ([]string, error)

func (*Database) GetClubEventCreators

func (d *Database) GetClubEventCreators(ctx context.Context, clubID string) ([]Member, error)

func (*Database) GetClubImportJobs

func (d *Database) GetClubImportJobs(ctx context.Context) ([]ClubImportJobWithClub, error)

func (*Database) GetClubMemberCheckInCounts

func (d *Database) GetClubMemberCheckInCounts(ctx context.Context, clubID string) ([]ClubMemberCheckInCount, error)

func (*Database) GetClubOptions

func (d *Database) GetClubOptions(ctx context.Context) ([]ClubRef, error)

GetClubOptions returns just the id and name of every club, ordered by name. It avoids the events join/count and the jsonb columns loaded by GetClubs, which matters when there are hundreds of clubs.

func (*Database) GetClubStatsEvents

func (d *Database) GetClubStatsEvents(ctx context.Context, clubID string) ([]ClubStatsEventRow, error)

func (*Database) GetClubStatsMonthly

func (d *Database) GetClubStatsMonthly(ctx context.Context, clubID string) ([]ClubStatsMonthRow, error)

func (*Database) GetClubStatsTotals

func (d *Database) GetClubStatsTotals(ctx context.Context, clubID string) (*ClubStatsTotals, error)

func (*Database) GetClubTotalCheckInsAccepted

func (d *Database) GetClubTotalCheckInsAccepted(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool, eventCreator string, eventCategory string) (int, int, error)

func (*Database) GetClubTotalCheckInsAcceptedExcludingLiveEventPatterns

func (d *Database) GetClubTotalCheckInsAcceptedExcludingLiveEventPatterns(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool, eventCreator string, eventCategory string, excludeLiveEventPatterns []string) (int, int, error)

func (*Database) GetClubs

func (d *Database) GetClubs(ctx context.Context, order string) ([]ClubWithEvents, error)

func (*Database) GetDiscordUserPinnedClubs

func (d *Database) GetDiscordUserPinnedClubs(ctx context.Context, userID string) ([]string, error)

func (*Database) GetDiscordUserRaffleBlockedMemberIDs

func (d *Database) GetDiscordUserRaffleBlockedMemberIDs(ctx context.Context, userID string) ([]string, error)

func (*Database) GetDiscordUserRaffleBlockedMembers

func (d *Database) GetDiscordUserRaffleBlockedMembers(ctx context.Context, userID string) ([]Member, error)

func (*Database) GetEvent

func (d *Database) GetEvent(ctx context.Context, eventID string) (*EventWithCreator, error)

func (*Database) GetEventCheckInAcceptedCounts

func (d *Database) GetEventCheckInAcceptedCounts(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool, eventCreator string, eventCategory string) ([]EventNumbers, error)

func (*Database) GetEventMembers

func (d *Database) GetEventMembers(ctx context.Context, eventID string) ([]EventMember, error)

func (*Database) GetEvents

func (d *Database) GetEvents(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool, eventCreator string, eventCategory string) ([]EventWithCheckIns, error)

func (*Database) GetLiveEventRSVPs

func (d *Database) GetLiveEventRSVPs(ctx context.Context, clubIDs []string, liveEventIDs []string) ([]LiveEventMemberRSVP, error)

GetLiveEventRSVPs returns one row per (club, live event, member) for the given clubs and set of Campfire live event IDs. StatusRank is the member's best status within that live event at that club (2 = checked in, 1 = accepted only). Members who attended multiple meetups within the same live event at a club are deduplicated.

func (*Database) GetMember

func (d *Database) GetMember(ctx context.Context, memberID string) (*Member, error)

func (*Database) GetNextCampfireToken

func (d *Database) GetNextCampfireToken(ctx context.Context) (*CampfireToken, error)

func (*Database) GetNextClubImport

func (d *Database) GetNextClubImport(ctx context.Context) (*Club, error)

func (*Database) GetNextPendingClubImportJob

func (d *Database) GetNextPendingClubImportJob(ctx context.Context) (*ClubImportJob, error)

func (*Database) GetNextUpdateEvent

func (d *Database) GetNextUpdateEvent(ctx context.Context) (*Event, error)

func (*Database) GetOldEvents

func (d *Database) GetOldEvents(ctx context.Context) ([]OldEvent, error)

func (*Database) GetRaffleByID

func (d *Database) GetRaffleByID(ctx context.Context, id int) (*Raffle, error)

func (*Database) GetRaffleEvents

func (d *Database) GetRaffleEvents(ctx context.Context, raffleID int) ([]Event, error)

func (*Database) GetRaffleWinners

func (d *Database) GetRaffleWinners(ctx context.Context, raffleID int) ([]RaffleWinnerWithMember, error)

func (*Database) GetRafflesByUserID

func (d *Database) GetRafflesByUserID(ctx context.Context, userID string) ([]Raffle, error)

func (*Database) GetReward

func (d *Database) GetReward(ctx context.Context, id int, userID string) (*Reward, error)

func (*Database) GetRewardClubs

func (d *Database) GetRewardClubs(ctx context.Context) ([]Club, error)

func (*Database) GetRewardCode

func (d *Database) GetRewardCode(ctx context.Context, id int) (*RewardCodeWithUser, error)

func (*Database) GetRewardCodeByRedeemCode

func (d *Database) GetRewardCodeByRedeemCode(ctx context.Context, redeemCode string) (*RewardCodeWithUser, error)

func (*Database) GetRewardCodeByRedeemCodeAndIncreaseVisitedCount

func (d *Database) GetRewardCodeByRedeemCodeAndIncreaseVisitedCount(ctx context.Context, redeemCode string) (*RewardCodeWithUser, error)

func (*Database) GetRewardCodes

func (d *Database) GetRewardCodes(ctx context.Context, id int, filter string) ([]RewardCodeWithUser, error)

func (*Database) GetRewards

func (d *Database) GetRewards(ctx context.Context, userID string) ([]Reward, error)

func (*Database) GetSession

func (d *Database) GetSession(ctx context.Context, sessionID string) (*SessionWithUser, error)

func (*Database) GetTopEventsByClub

func (d *Database) GetTopEventsByClub(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool, eventCreator string, eventCategory string, sort string, limit int) ([]EventWithCheckIns, error)

func (*Database) GetTopMembersByClub

func (d *Database) GetTopMembersByClub(ctx context.Context, clubID string, from time.Time, to time.Time, caOnly bool, eventCreator string, eventCategory string, sort string, limit int) ([]TopMember, error)

func (*Database) GetUpcomingClubEvents

func (d *Database) GetUpcomingClubEvents(ctx context.Context, clubID string) ([]EventWithCheckIns, error)

func (*Database) IncreaseRewardCodeVisitedCount

func (d *Database) IncreaseRewardCodeVisitedCount(ctx context.Context, id int) error

func (*Database) InsertCampfireToken

func (d *Database) InsertCampfireToken(ctx context.Context, token CampfireToken) error

func (*Database) InsertClubImportJob

func (d *Database) InsertClubImportJob(ctx context.Context, job ClubImportJob) (int, error)

func (*Database) InsertClubs

func (d *Database) InsertClubs(ctx context.Context, clubs []Club) error

func (*Database) InsertEventRSVPs

func (d *Database) InsertEventRSVPs(ctx context.Context, rsvps []EventRSVP) error

func (*Database) InsertEvents

func (d *Database) InsertEvents(ctx context.Context, events []Event) error

func (*Database) InsertMembers

func (d *Database) InsertMembers(ctx context.Context, members []Member) error

InsertMembers inserts or updates multiple members in the database. Fields which are an empty string will not be updated.

func (*Database) InsertRaffle

func (d *Database) InsertRaffle(ctx context.Context, raffle Raffle) (int, error)

func (*Database) InsertRaffleWinners

func (d *Database) InsertRaffleWinners(ctx context.Context, raffleID int, memberIDs []string) error

func (*Database) InsertReward

func (d *Database) InsertReward(ctx context.Context, reward Reward) (int, error)

func (*Database) InsertRewardCodes

func (d *Database) InsertRewardCodes(ctx context.Context, id int, codes []string, userID string) error

func (*Database) MarkRaffleWinnersAsPast

func (d *Database) MarkRaffleWinnersAsPast(ctx context.Context, raffleID int) error

func (*Database) RemoveDiscordUserPinnedClub

func (d *Database) RemoveDiscordUserPinnedClub(ctx context.Context, userID, clubID string) error

func (*Database) RemoveDiscordUserRaffleBlockedMember

func (d *Database) RemoveDiscordUserRaffleBlockedMember(ctx context.Context, userID, memberID string) error

func (*Database) RemoveRaffleEvents

func (d *Database) RemoveRaffleEvents(ctx context.Context, raffleID int, eventIDs []string) error

func (*Database) SearchMembers

func (d *Database) SearchMembers(ctx context.Context, query string, limit int) ([]Member, error)

func (*Database) UpdateClub

func (d *Database) UpdateClub(ctx context.Context, clubID string, autoImport bool, verificationChannelID *string) error

func (*Database) UpdateClubImportJob

func (d *Database) UpdateClubImportJob(ctx context.Context, job ClubImportJob) error

func (*Database) UpdateClubLastAutoEventImported

func (d *Database) UpdateClubLastAutoEventImported(ctx context.Context, clubID string) error

func (*Database) UpdateEventCategory

func (d *Database) UpdateEventCategory(ctx context.Context, eventID string, category string) error

func (*Database) UpdateEventLastAutoImported

func (d *Database) UpdateEventLastAutoImported(ctx context.Context, eventID string) error

func (*Database) UpdateReward

func (d *Database) UpdateReward(ctx context.Context, reward Reward) error

func (*Database) UpdateRewardCodeRedeemed

func (d *Database) UpdateRewardCodeRedeemed(ctx context.Context, id int, at *time.Time, userID *string) error

func (*Database) UpsertDiscordUser

func (d *Database) UpsertDiscordUser(ctx context.Context, user DiscordUser) error

type DiscordUser

type DiscordUser struct {
	ID          string    `db:"discord_user_id"`
	Username    string    `db:"discord_user_username"`
	DisplayName string    `db:"discord_user_display_name"`
	AvatarURL   string    `db:"discord_user_avatar_url"`
	ImportedAt  time.Time `db:"discord_user_imported_at"`
}

type Event

type Event struct {
	ID                           string          `db:"event_id"`
	Name                         string          `db:"event_name"`
	Details                      string          `db:"event_details"`
	Address                      string          `db:"event_address"`
	Location                     string          `db:"event_location"`
	CreatorID                    string          `db:"event_creator_id"`
	CoverPhotoURL                string          `db:"event_cover_photo_url"`
	Time                         time.Time       `db:"event_time"`
	EndTime                      time.Time       `db:"event_end_time"`
	Finished                     bool            `db:"event_finished"`
	DiscordInterested            int             `db:"event_discord_interested"`
	CreatedByCommunityAmbassador bool            `db:"event_created_by_community_ambassador"`
	CampfireLiveEventID          string          `db:"event_campfire_live_event_id"`
	CampfireLiveEventName        string          `db:"event_campfire_live_event_name"`
	Category                     string          `db:"event_category"`
	ClubID                       string          `db:"event_club_id"`
	ImportedAt                   time.Time       `db:"event_imported_at"`
	RawJSON                      json.RawMessage `db:"event_raw_json"`
	LastAutoImportedAt           time.Time       `db:"event_last_auto_imported_at"`
}

type EventMember

type EventMember struct {
	Member
	EventRSVP
}

type EventNumbers

type EventNumbers struct {
	CampfireLiveEventID   string `db:"event_campfire_live_event_id"`
	CampfireLiveEventName string `db:"event_campfire_live_event_name"`
	Category              string `db:"event_category"`
	Events                int    `db:"events"`
	CheckIns              int    `db:"check_ins"`
	Accepted              int    `db:"accepted"`
}

type EventRSVP

type EventRSVP struct {
	EventID    string    `db:"event_rsvp_event_id"`
	MemberID   string    `db:"event_rsvp_member_id"`
	Status     string    `db:"event_rsvp_status"`
	ImportedAt time.Time `db:"event_rsvp_imported_at"`
}

type EventState

type EventState struct {
	Event   Event       `json:"event"`
	Creator Member      `json:"creator"`
	RSVPs   []EventRSVP `json:"rsvps"`
}

type EventWithCheckIns

type EventWithCheckIns struct {
	Event
	Accepted int `db:"accepted"`
	CheckIns int `db:"check_ins"`
}

type EventWithClub

type EventWithClub struct {
	Event
	Club
}

type EventWithCreator

type EventWithCreator struct {
	Event
	Member
}

type LiveEventMemberRSVP

type LiveEventMemberRSVP struct {
	Member
	ClubID      string `db:"club_id"`
	LiveEventID string `db:"live_event_id"`
	StatusRank  int    `db:"status_rank"`
}

LiveEventMemberRSVP is one member's aggregated RSVP status within a single Campfire live event (across all of that live event's meetups for a club). StatusRank is 2 for CHECKED_IN, 1 for ACCEPTED only, 0 otherwise.

type Member

type Member struct {
	ID          string          `db:"member_id"`
	Username    string          `db:"member_username"`
	DisplayName string          `db:"member_display_name"`
	AvatarURL   string          `db:"member_avatar_url"`
	ImportedAt  time.Time       `db:"member_imported_at"`
	RawJSON     json.RawMessage `db:"member_raw_json"`
}

type OldEvent

type OldEvent struct {
	ID            string    `db:"id"`
	Name          string    `db:"name"`
	Details       string    `db:"details"`
	CoverPhotoURL string    `db:"cover_photo_url"`
	EventTime     time.Time `db:"event_time"`
	EventEndTime  time.Time `db:"event_end_time"`

	CampfireLiveEventID   string `db:"campfire_live_event_id"`
	CampfireLiveEventName string `db:"campfire_live_event_name"`

	ClubID        string `db:"club_id"`
	ClubName      string `db:"club_name"`
	ClubAvatarURL string `db:"club_avatar_url"`

	RawJSON json.RawMessage `db:"raw_json"`
}

type Raffle

type Raffle struct {
	ID            int            `db:"raffle_id"`
	UserID        string         `db:"raffle_user_id"`
	Events        pq.StringArray `db:"raffle_events"`
	WinnerCount   int            `db:"raffle_winner_count"`
	OnlyCheckedIn bool           `db:"raffle_only_checked_in"`
	SingleEntry   bool           `db:"raffle_single_entry"`
	CreatedAt     time.Time      `db:"raffle_created_at"`
}

type RaffleWinner

type RaffleWinner struct {
	RaffleID  int       `db:"raffle_winner_raffle_id"`
	MemberID  string    `db:"raffle_winner_member_id"`
	Confirmed bool      `db:"raffle_winner_confirmed"`
	Past      bool      `db:"raffle_winner_past"`
	CreatedAt time.Time `db:"raffle_winner_created_at"`
}

type RaffleWinnerWithMember

type RaffleWinnerWithMember struct {
	RaffleWinner
	Member
	Accepted int `db:"accepted"`
	CheckIns int `db:"check_ins"`
}

type Reward

type Reward struct {
	ID            int    `db:"reward_id"`
	Name          string `db:"reward_name"`
	Description   string `db:"reward_description"`
	CreatedBy     string `db:"reward_created_by"`
	CreatedAt     string `db:"reward_created_at"`
	TotalCodes    int    `db:"reward_total_codes"`
	RedeemedCodes int    `db:"reward_redeemed_codes"`
}

type RewardCode

type RewardCode struct {
	ID           int        `db:"reward_code_id"`
	Code         string     `db:"reward_code_code"`
	RewardID     int        `db:"reward_code_reward_id"`
	ImportedAt   time.Time  `db:"reward_code_imported_at"`
	ImportedBy   string     `db:"reward_code_imported_by"`
	RedeemCode   string     `db:"reward_code_redeem_code"`
	RedeemedAt   *time.Time `db:"reward_code_redeemed_at"`
	RedeemedBy   *string    `db:"reward_code_redeemed_by"`
	VisitedCount int        `db:"reward_code_visited_count"`
}

type RewardCodeWithUser

type RewardCodeWithUser struct {
	RewardCode
	ImportedByUser DiscordUser `db:"imported_by_user"`
	RedeemedByUser struct {
		ID          *string `db:"discord_user_id"`
		Username    *string `db:"discord_user_username"`
		DisplayName *string `db:"discord_user_display_name"`
		AvatarURL   *string `db:"discord_user_avatar_url"`
	} `db:"redeemed_by_user"`
}

type RewardSession

type RewardSession struct {
	ID           int       `db:"reward_session_id"`
	CreatedAt    time.Time `db:"reward_session_created_at"`
	ExpiresAt    time.Time `db:"reward_session_expires_at"`
	RewardUserID string    `db:"reward_session_reward_user_id"`
}

type RewardUser

type RewardUser struct {
	ID           int       `db:"reward_user_id"`
	CreatedAt    time.Time `db:"reward_user_created_at"`
	MemberID     string    `db:"reward_user_member_id"`
	PasswordHash string    `db:"reward_user_password_hash"`
	PasswordSalt string    `db:"reward_user_password_salt"`
}

type Session

type Session struct {
	ID        string    `db:"session_id"`
	CreatedAt time.Time `db:"session_created_at"`
	ExpiresAt time.Time `db:"session_expires_at"`
	UserID    string    `db:"session_user_id"`
	Admin     bool      `db:"session_admin"`
}

type SessionWithUser

type SessionWithUser struct {
	Session
	DiscordUser
}

type TopMember

type TopMember struct {
	Member
	Accepted int `db:"accepted"`
	CheckIns int `db:"check_ins"`
}

Jump to

Keyboard shortcuts

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