Documentation
¶
Index ¶
- type Challenge
- type Comment
- type CommentVote
- type CreateCommentDownVoteParams
- type CreateCommentParams
- type CreateCommentUnVoteParams
- type CreateCommentUpVoteParams
- type CreateThreadDownVoteParams
- type CreateThreadParams
- type CreateThreadUnVoteParams
- type CreateThreadUpVoteParams
- type DBTX
- type DeleteTransfersParams
- type GetCommentRow
- type GetCommentsParams
- type GetCommentsRow
- type GetThreadRow
- type GetThreadsRow
- type IndexerProgress
- type InsertTransfersParams
- type Queries
- func (q *Queries) AddReputation(ctx context.Context, dollar_1 []string) error
- func (q *Queries) AggregateCommentVotes(ctx context.Context, commentID int64) error
- func (q *Queries) AggregateThreadVotes(ctx context.Context, threadID int64) error
- func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (int64, error)
- func (q *Queries) CreateCommentDownVote(ctx context.Context, arg CreateCommentDownVoteParams) error
- func (q *Queries) CreateCommentUnVote(ctx context.Context, arg CreateCommentUnVoteParams) error
- func (q *Queries) CreateCommentUpVote(ctx context.Context, arg CreateCommentUpVoteParams) error
- func (q *Queries) CreateThread(ctx context.Context, arg CreateThreadParams) (int64, error)
- func (q *Queries) CreateThreadDownVote(ctx context.Context, arg CreateThreadDownVoteParams) error
- func (q *Queries) CreateThreadUnVote(ctx context.Context, arg CreateThreadUnVoteParams) error
- func (q *Queries) CreateThreadUpVote(ctx context.Context, arg CreateThreadUpVoteParams) error
- func (q *Queries) DeductReputation(ctx context.Context, dollar_1 []string) error
- func (q *Queries) DeleteComment(ctx context.Context, id int64) (int64, error)
- func (q *Queries) DeleteThread(ctx context.Context, id int64) (int64, error)
- func (q *Queries) DeleteTransfers(ctx context.Context, arg DeleteTransfersParams) error
- func (q *Queries) GetChallenge(ctx context.Context, address string) (Challenge, error)
- func (q *Queries) GetComment(ctx context.Context, id int64) (GetCommentRow, error)
- func (q *Queries) GetComments(ctx context.Context, arg GetCommentsParams) ([]GetCommentsRow, error)
- func (q *Queries) GetLastIndexedBlock(ctx context.Context) (pgtype.Numeric, error)
- func (q *Queries) GetThread(ctx context.Context, id int64) (GetThreadRow, error)
- func (q *Queries) GetThreads(ctx context.Context, dollar_1 int64) ([]GetThreadsRow, error)
- func (q *Queries) GetUser(ctx context.Context, address string) (User, error)
- func (q *Queries) InsertTransfers(ctx context.Context, arg []InsertTransfersParams) (int64, error)
- func (q *Queries) UpdateChallenge(ctx context.Context, arg UpdateChallengeParams) error
- func (q *Queries) UpdateLastIndexedBlock(ctx context.Context, lastIndexedBlock pgtype.Numeric) error
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
- func (q *Queries) UpsertUser(ctx context.Context, address string) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- func (q *Queries) ZeroReputation(ctx context.Context, dollar_1 []string) error
- type Thread
- type ThreadVote
- type Transfer
- type UpdateChallengeParams
- type UpdateUserParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct {
ID int64
ThreadID int64
RepliedToCommentID pgtype.Int8
Address string
Content string
ImageFileName string
ImageOriginalUrl string
ImageOriginalContentType string
ImageFormattedUrl string
ImageFormattedContentType string
Votes int64
IsDeleted bool
CreatedAt pgtype.Timestamp
DeletedAt pgtype.Timestamp
}
type CommentVote ¶
type CreateCommentParams ¶
type CreateThreadParams ¶
type DBTX ¶
type DBTX interface {
Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
Query(context.Context, string, ...interface{}) (pgx.Rows, error)
QueryRow(context.Context, string, ...interface{}) pgx.Row
CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}
type DeleteTransfersParams ¶
type GetCommentRow ¶
type GetCommentRow struct {
ID int64
ThreadID int64
RepliedToCommentID pgtype.Int8
Address string
Content string
ImageFileName string
ImageOriginalUrl string
ImageOriginalContentType string
ImageFormattedUrl string
ImageFormattedContentType string
Votes int64
IsDeleted bool
CreatedAt pgtype.Timestamp
DeletedAt pgtype.Timestamp
RID pgtype.Int8
RAddress pgtype.Text
RContent pgtype.Text
RImageFileName pgtype.Text
RImageOriginalUrl pgtype.Text
RImageOriginalContentType pgtype.Text
RImageFormattedUrl pgtype.Text
RImageFormattedContentType pgtype.Text
RIsDeleted pgtype.Bool
RCreatedAt pgtype.Timestamp
RDeletedAt pgtype.Timestamp
Address_2 string
EnsName pgtype.Text
EnsAvatarFileName pgtype.Text
EnsAvatarOriginalUrl pgtype.Text
EnsAvatarOriginalContentType pgtype.Text
EnsAvatarFormattedUrl pgtype.Text
EnsAvatarFormattedContentType pgtype.Text
Reputation pgtype.Numeric
UserCreatedAt pgtype.Timestamp
UserUpdatedAt pgtype.Timestamp
}
type GetCommentsParams ¶
type GetCommentsRow ¶
type GetCommentsRow struct {
ID int64
ThreadID int64
RepliedToCommentID pgtype.Int8
Address string
Content string
ImageFileName string
ImageOriginalUrl string
ImageOriginalContentType string
ImageFormattedUrl string
ImageFormattedContentType string
Votes int64
IsDeleted bool
CreatedAt pgtype.Timestamp
DeletedAt pgtype.Timestamp
RID pgtype.Int8
RAddress pgtype.Text
RContent pgtype.Text
RImageFileName pgtype.Text
RImageOriginalUrl pgtype.Text
RImageOriginalContentType pgtype.Text
RImageFormattedUrl pgtype.Text
RImageFormattedContentType pgtype.Text
RIsDeleted pgtype.Bool
RCreatedAt pgtype.Timestamp
RDeletedAt pgtype.Timestamp
Address_2 string
EnsName pgtype.Text
EnsAvatarFileName pgtype.Text
EnsAvatarOriginalUrl pgtype.Text
EnsAvatarOriginalContentType pgtype.Text
EnsAvatarFormattedUrl pgtype.Text
EnsAvatarFormattedContentType pgtype.Text
Reputation pgtype.Numeric
UserCreatedAt pgtype.Timestamp
UserUpdatedAt pgtype.Timestamp
FullCount int64
}
type GetThreadRow ¶
type GetThreadRow struct {
ID int64
Address string
Title string
Content string
ImageFileName string
ImageOriginalUrl string
ImageOriginalContentType string
ImageFormattedUrl string
ImageFormattedContentType string
Votes int64
IsDeleted bool
CreatedAt pgtype.Timestamp
DeletedAt pgtype.Timestamp
Address_2 string
EnsName pgtype.Text
EnsAvatarFileName pgtype.Text
EnsAvatarOriginalUrl pgtype.Text
EnsAvatarOriginalContentType pgtype.Text
EnsAvatarFormattedUrl pgtype.Text
EnsAvatarFormattedContentType pgtype.Text
Reputation pgtype.Numeric
UserCreatedAt pgtype.Timestamp
UserUpdatedAt pgtype.Timestamp
}
type GetThreadsRow ¶
type GetThreadsRow struct {
ID int64
Address string
Title string
Content string
ImageFileName string
ImageOriginalUrl string
ImageOriginalContentType string
ImageFormattedUrl string
ImageFormattedContentType string
Votes int64
IsDeleted bool
CreatedAt pgtype.Timestamp
DeletedAt pgtype.Timestamp
Address_2 string
EnsName pgtype.Text
EnsAvatarFileName pgtype.Text
EnsAvatarOriginalUrl pgtype.Text
EnsAvatarOriginalContentType pgtype.Text
EnsAvatarFormattedUrl pgtype.Text
EnsAvatarFormattedContentType pgtype.Text
Reputation pgtype.Numeric
UserCreatedAt pgtype.Timestamp
UserUpdatedAt pgtype.Timestamp
}
type IndexerProgress ¶
type InsertTransfersParams ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddReputation ¶
if the user address is the to_address, then add the amount
func (*Queries) AggregateCommentVotes ¶
func (*Queries) AggregateThreadVotes ¶
func (*Queries) CreateComment ¶
func (*Queries) CreateCommentDownVote ¶
func (q *Queries) CreateCommentDownVote(ctx context.Context, arg CreateCommentDownVoteParams) error
func (*Queries) CreateCommentUnVote ¶
func (q *Queries) CreateCommentUnVote(ctx context.Context, arg CreateCommentUnVoteParams) error
func (*Queries) CreateCommentUpVote ¶
func (q *Queries) CreateCommentUpVote(ctx context.Context, arg CreateCommentUpVoteParams) error
func (*Queries) CreateThread ¶
func (*Queries) CreateThreadDownVote ¶
func (q *Queries) CreateThreadDownVote(ctx context.Context, arg CreateThreadDownVoteParams) error
only update the vote if the incoming vote is newer than the current vote
func (*Queries) CreateThreadUnVote ¶
func (q *Queries) CreateThreadUnVote(ctx context.Context, arg CreateThreadUnVoteParams) error
func (*Queries) CreateThreadUpVote ¶
func (q *Queries) CreateThreadUpVote(ctx context.Context, arg CreateThreadUpVoteParams) error
func (*Queries) DeductReputation ¶
if the user address is the from_address, then deduct the amount
func (*Queries) DeleteComment ¶
func (*Queries) DeleteThread ¶
func (*Queries) DeleteTransfers ¶
func (q *Queries) DeleteTransfers(ctx context.Context, arg DeleteTransfersParams) error
func (*Queries) GetChallenge ¶
func (*Queries) GetComment ¶
func (*Queries) GetComments ¶
func (q *Queries) GetComments(ctx context.Context, arg GetCommentsParams) ([]GetCommentsRow, error)
func (*Queries) GetLastIndexedBlock ¶
func (*Queries) GetThreads ¶
Order by random is not performant as we need to do a full table scan. Move to TABLESAMPLE SYSTEM_ROWS(N) when performance becomes an issue. Table sample is not random enough until the table gets big. https://www.postgresql.org/docs/current/tsm-system-rows.html
func (*Queries) InsertTransfers ¶
func (*Queries) UpdateChallenge ¶
func (q *Queries) UpdateChallenge(ctx context.Context, arg UpdateChallengeParams) error
func (*Queries) UpdateLastIndexedBlock ¶
func (*Queries) UpdateUser ¶
func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) error
func (*Queries) UpsertUser ¶
upsert user every time they signin so we don't have to check if they exist
type ThreadVote ¶
type UpdateChallengeParams ¶
type UpdateUserParams ¶
type User ¶
type User struct {
Address string
EnsName pgtype.Text
CreatedAt pgtype.Timestamp
UpdatedAt pgtype.Timestamp
Reputation pgtype.Numeric
EnsAvatarFileName pgtype.Text
EnsAvatarOriginalUrl pgtype.Text
EnsAvatarOriginalContentType pgtype.Text
EnsAvatarFormattedUrl pgtype.Text
EnsAvatarFormattedContentType pgtype.Text
}
Click to show internal directories.
Click to hide internal directories.