Documentation ¶
Index ¶
- type CreateVoteParams
- type DBTX
- type GetNextPollRow
- type GetPollRow
- type GetPresentationAndPollParams
- type GetPresentationAndPollRow
- type GetPreviousPollRow
- type GetVotesParams
- type GetVotesRow
- type ListPollsRow
- type Option
- type Poll
- type Presentation
- type Querier
- type Queries
- func (q *Queries) CreatePresentationAndPolls(ctx context.Context, polls json.RawMessage) (uuid.UUID, error)
- func (q *Queries) CreateVote(ctx context.Context, arg CreateVoteParams) error
- func (q *Queries) GetNextPoll(ctx context.Context, id uuid.UUID) (GetNextPollRow, error)
- func (q *Queries) GetPoll(ctx context.Context, presentationid uuid.UUID) (GetPollRow, error)
- func (q *Queries) GetPresentation(ctx context.Context, id uuid.UUID) (Presentation, error)
- func (q *Queries) GetPresentationAndPoll(ctx context.Context, arg GetPresentationAndPollParams) (GetPresentationAndPollRow, error)
- func (q *Queries) GetPreviousPoll(ctx context.Context, id uuid.UUID) (GetPreviousPollRow, error)
- func (q *Queries) GetVotes(ctx context.Context, arg GetVotesParams) ([]GetVotesRow, error)
- func (q *Queries) ListPolls(ctx context.Context, presentationid uuid.UUID) ([]ListPollsRow, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SQLStore
- func (store *SQLStore) GetCurrentPoll(ctx context.Context, id uuid.UUID) (model.CurrentPoll, error)
- func (store *SQLStore) UpdateCurrentPollToForwardTx(ctx context.Context, id uuid.UUID) (model.CurrentPoll, error)
- func (store *SQLStore) UpdateCurrentPollToPreviousTx(ctx context.Context, id uuid.UUID) (model.CurrentPoll, error)
- func (store *SQLStore) VoteCurrentPollTx(ctx context.Context, arg VoteParams) error
- type Store
- type Vote
- type VoteParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateVoteParams ¶
type GetNextPollRow ¶
type GetNextPollRow struct { ID uuid.UUID `db:"id" json:"id"` Question string `db:"question" json:"question"` Options json.RawMessage `db:"options" json:"options"` }
type GetPollRow ¶
type GetPollRow struct { ID uuid.UUID `db:"id" json:"id"` Question string `db:"question" json:"question"` Options json.RawMessage `db:"options" json:"options"` }
type GetPresentationAndPollRow ¶
type GetPresentationAndPollRow struct { PresentationID uuid.UUID `db:"presentation_id" json:"presentation_id"` Currentpollindex sql.NullInt32 `db:"currentpollindex" json:"currentpollindex"` PollID uuid.UUID `db:"poll_id" json:"poll_id"` Question string `db:"question" json:"question"` Pollindex int32 `db:"pollindex" json:"pollindex"` }
type GetPreviousPollRow ¶
type GetPreviousPollRow struct { ID uuid.UUID `db:"id" json:"id"` Question string `db:"question" json:"question"` Options json.RawMessage `db:"options" json:"options"` }
type GetVotesParams ¶
type GetVotesRow ¶
type ListPollsRow ¶
type ListPollsRow struct { ID uuid.UUID `db:"id" json:"id"` Question string `db:"question" json:"question"` Options json.RawMessage `db:"options" json:"options"` }
type Presentation ¶
type Querier ¶
type Querier interface { CreatePresentationAndPolls(ctx context.Context, polls json.RawMessage) (uuid.UUID, error) CreateVote(ctx context.Context, arg CreateVoteParams) error GetNextPoll(ctx context.Context, id uuid.UUID) (GetNextPollRow, error) GetPoll(ctx context.Context, presentationid uuid.UUID) (GetPollRow, error) GetPresentation(ctx context.Context, id uuid.UUID) (Presentation, error) GetPresentationAndPoll(ctx context.Context, arg GetPresentationAndPollParams) (GetPresentationAndPollRow, error) GetPreviousPoll(ctx context.Context, id uuid.UUID) (GetPreviousPollRow, error) GetVotes(ctx context.Context, arg GetVotesParams) ([]GetVotesRow, error) ListPolls(ctx context.Context, presentationid uuid.UUID) ([]ListPollsRow, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreatePresentationAndPolls ¶
func (*Queries) CreateVote ¶
func (q *Queries) CreateVote(ctx context.Context, arg CreateVoteParams) error
func (*Queries) GetNextPoll ¶
func (*Queries) GetPresentation ¶
func (*Queries) GetPresentationAndPoll ¶
func (q *Queries) GetPresentationAndPoll(ctx context.Context, arg GetPresentationAndPollParams) (GetPresentationAndPollRow, error)
func (*Queries) GetPreviousPoll ¶
func (*Queries) GetVotes ¶
func (q *Queries) GetVotes(ctx context.Context, arg GetVotesParams) ([]GetVotesRow, error)
type SQLStore ¶
type SQLStore struct { *Queries // contains filtered or unexported fields }
SQLStore provides all functions to execute SQL queries and transactions
func (*SQLStore) GetCurrentPoll ¶
func (*SQLStore) UpdateCurrentPollToForwardTx ¶
func (*SQLStore) UpdateCurrentPollToPreviousTx ¶
func (*SQLStore) VoteCurrentPollTx ¶
func (store *SQLStore) VoteCurrentPollTx(ctx context.Context, arg VoteParams) error
type Store ¶
type Store interface { Querier GetCurrentPoll(context.Context, uuid.UUID) (model.CurrentPoll, error) UpdateCurrentPollToForwardTx(ctx context.Context, id uuid.UUID) (model.CurrentPoll, error) UpdateCurrentPollToPreviousTx(ctx context.Context, id uuid.UUID) (model.CurrentPoll, error) VoteCurrentPollTx(context.Context, VoteParams) error }
Store defines all functions to execute db queries and transactions
Click to show internal directories.
Click to hide internal directories.