store

package
v0.0.0-...-28cf77b Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANALYTICS_VIEW_COUNTER_TYPE_BOOK    int16 = 0
	ANALYTICS_VIEW_COUNTER_TYPE_CHAPTER int16 = 1
)

Variables

View Source
var ErrNoRows = pgx.ErrNoRows

Functions

func Connect

func Connect(ctx context.Context, connectionString string) (*pgxpool.Pool, error)

func CountBooks

func CountBooks(ctx context.Context, db DBTX, req BookSearchRequest, limit uint) (int64, error)

func CountTags

func CountTags(
	ctx context.Context,
	db DBTX,
	req ListTagsQuery,
) (int64, error)

func CountUsers

func CountUsers(ctx context.Context, db DBTX, req *UsersQuery) (int64, error)

func PGArrayExpr

func PGArrayExpr[T any](arr []T) goqu.Expression

PGArrayExpr takes a slice of items and returns a literal expression with a Postgres array that can be used by goqu. It does this by using goqu natively and then manipulating the string to surround it in an array literal.

To use this in a struct, you can do something like:

type MyModel struct {
  Tags   []string        `json:"tags" db:"-"`
  DbTags goqu.Expression `json:"-" db:"tags"`
}
body := `{"tags":["x", "y"]}`
m := MyModel{}
_ = json.Unmarshal([]byte(body), &m)
m.DbTags = goqux.PGArrayExpr(m.Tags)
sql, _, _ := goqu.Insert("modeltable").Rows(m).ToSQL()

Types

type AgeRating

type AgeRating string
const (
	AgeRatingValue0 AgeRating = "?"
	AgeRatingG      AgeRating = "G"
	AgeRatingPG     AgeRating = "PG"
	AgeRatingPG13   AgeRating = "PG-13"
	AgeRatingR      AgeRating = "R"
	AgeRatingNC17   AgeRating = "NC-17"
)

func (*AgeRating) Scan

func (e *AgeRating) Scan(src interface{}) error

type Analytics_GetChapterViewsParams

type Analytics_GetChapterViewsParams struct {
	BookID      int64
	YearPeriod  int32
	MonthPeriod int32
	WeekPeriod  int32
	DayPeriod   int32
	HourPeriod  int32
}

type Analytics_GetChapterViewsRow

type Analytics_GetChapterViewsRow struct {
	Period       int32
	AggViewCount int64
}

type Analytics_GetMostViewedBooksByBookViewsOnlyParams

type Analytics_GetMostViewedBooksByBookViewsOnlyParams struct {
	Period int32
	Limit  int32
}

type Analytics_GetMostViewedBooksByBookViewsOnlyRow

type Analytics_GetMostViewedBooksByBookViewsOnlyRow struct {
	BookID    int64
	ViewCount int64
}

type Analytics_GetViewsParams

type Analytics_GetViewsParams struct {
	BookID      int64
	YearPeriod  int32
	MonthPeriod int32
	WeekPeriod  int32
	DayPeriod   int32
	HourPeriod  int32
}

type Analytics_GetViewsRow

type Analytics_GetViewsRow struct {
	Period    int32
	ViewCount int64
}

type Analytics_GetViews_MultipleParams

type Analytics_GetViews_MultipleParams struct {
	BookID      []int64
	YearPeriod  int32
	MonthPeriod int32
	WeekPeriod  int32
	DayPeriod   int32
	HourPeriod  int32
}

type Analytics_GetViews_MultipleRow

type Analytics_GetViews_MultipleRow struct {
	Period    int32
	ViewCount int64
	BookID    int64
}

type Analytics_IncrViewParams

type Analytics_IncrViewParams struct {
	Period     int32
	BookID     int64
	IncrBy     int64
	EntityType int16
	EntityID   int64
}

type Book

type Book struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
}

type BookActionType

type BookActionType string
const (
	BookActionTypeSignificantUpdate BookActionType = "significant_update"
	BookActionTypeAuthorTransfer    BookActionType = "author_transfer"
	BookActionTypeCoauthorAdded     BookActionType = "coauthor_added"
	BookActionTypeCoauthorRemoved   BookActionType = "coauthor_removed"
	BookActionTypeBan               BookActionType = "ban"
	BookActionTypeShadowBan         BookActionType = "shadow_ban"
	BookActionTypePermRemoval       BookActionType = "perm_removal"
	BookActionTypeUnBan             BookActionType = "un_ban"
	BookActionTypeUnShadowBan       BookActionType = "un_shadow_ban"
	BookActionTypeReindex           BookActionType = "reindex"
)

func (*BookActionType) Scan

func (e *BookActionType) Scan(src interface{}) error

type BookChapter

type BookChapter struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	ContentUpdatedAt  pgtype.Timestamptz
	Order             int32
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	IsAdultOverride   bool
	Summary           string
	IsPubliclyVisible bool
}

type BookLog

type BookLog struct {
	ID          int64
	Time        pgtype.Timestamptz
	BookID      int64
	ActionType  BookActionType
	Payload     []byte
	ActorUserID pgtype.UUID
	Reason      string
}

type BookSearchFilter

type BookSearchFilter struct {
	Query string

	Words           Int4Range
	WordsPerChapter Int4Range
	Chapters        Int4Range

	IncludeAuthors []pgtype.UUID
	ExcludeAuthors []pgtype.UUID

	IncludeParentTags []int64
	ExcludeParentTags []int64

	IncludeBanned bool
	IncludeHidden bool
	IncludeEmpty  bool
}

type BookSearchRequest

type BookSearchRequest struct {
	BookSearchFilter
	Page     uint
	PageSize uint
}

type BookSearchRow

type BookSearchRow struct {
	ID                 int64              `db:"id"`
	Name               string             `db:"name"`
	Summary            string             `db:"summary"`
	CreatedAt          pgtype.Timestamptz `db:"created_at"`
	AgeRating          AgeRating          `db:"age_rating"`
	Words              int                `db:"words"`
	Chapters           int                `db:"chapters"`
	TagIds             []int64            `db:"tag_ids"`
	CachedParentTagIds []int64            `db:"cached_parent_tag_ids"`
	AuthorUserID       pgtype.UUID        `db:"author_user_id"`
	AuthorName         string             `db:"author_name"`
	HasCover           bool               `db:"has_cover"`
}

func SearchBooks

func SearchBooks(ctx context.Context, db DBTX, req BookSearchRequest) ([]BookSearchRow, error)

type BookSetCoverParams

type BookSetCoverParams struct {
	ID    int64
	Cover string
}

type BookStats

type BookStats struct {
	ChaptersMin        int64 `db:"chapters_min"`
	ChaptersMax        int64 `db:"chapters_max"`
	WordsMin           int64 `db:"words_min"`
	WordsMax           int64 `db:"words_max"`
	WordsPerChapterMin int64 `db:"words_per_chapter_min"`
	WordsPerChapterMax int64 `db:"words_per_chapter_max"`
	FavoritesMin       int64 `db:"favorites_min"`
	FavoritesMax       int64 `db:"favorites_max"`
}

func GetBooksFilterExtremes

func GetBooksFilterExtremes(ctx context.Context, db DBTX, req *BookSearchFilter) (BookStats, error)

type Book_Book_ManagerGetUserBooksCountParams

type Book_Book_ManagerGetUserBooksCountParams struct {
	AuthorUserID pgtype.UUID
	Search       string
}

type Book_GetByUserParams

type Book_GetByUserParams struct {
	AuthorUserID pgtype.UUID
	Limit        int32
	Offset       int32
}

type Book_GetChapterOrderRow

type Book_GetChapterOrderRow struct {
	Order int32
	ID    int64
}

type Book_GetPubliclyVisibleChaptersRow

type Book_GetPubliclyVisibleChaptersRow struct {
	ID              int64
	Name            string
	Words           int32
	Order           int32
	CreatedAt       pgtype.Timestamptz
	Summary         string
	IsAdultOverride bool
}

type Book_InsertChapterParams

type Book_InsertChapterParams struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	Order             int32
	CreatedAt         pgtype.Timestamptz
	Words             int32
	Summary           string
	IsPubliclyVisible bool
}

type Book_InsertParams

type Book_InsertParams struct {
	ID                 int64
	Name               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	TagIds             []int64
	CachedParentTagIds []int64
	IsPubliclyVisible  bool
	Slug               string
}

type Book_ManagerGetUserBooksParams

type Book_ManagerGetUserBooksParams struct {
	Limit        int32
	Offset       int32
	AuthorUserID pgtype.UUID
	Search       string
}

type Book_ManagerGetUserBooksRow

type Book_ManagerGetUserBooksRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
	CollectionID       pgtype.Int8
	CollectionName     pgtype.Text
	CollectionPosition pgtype.Int4
	CollectionSize     pgtype.Int4
}

type Book_SetChapterOrderParams

type Book_SetChapterOrderParams struct {
	ID    int64
	Order int32
}

type Book_UnTrashParams

type Book_UnTrashParams struct {
	ID                int64
	IsPubliclyVisible bool
}

type CensorMode

type CensorMode string
const (
	CensorModeHide   CensorMode = "hide"
	CensorModeCensor CensorMode = "censor"
	CensorModeNone   CensorMode = "none"
)

func (*CensorMode) Scan

func (e *CensorMode) Scan(src interface{}) error

type Chapter_UpdateParams

type Chapter_UpdateParams struct {
	ID                int64
	Name              string
	Content           string
	Words             int32
	Summary           string
	IsPubliclyVisible bool
	ContentUpdatedAt  pgtype.Timestamptz
}

type Collection

type Collection struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
}

type CollectionBook

type CollectionBook struct {
	CollectionID int64
	BookID       int64
	AddedAt      pgtype.Timestamptz
	Order        int32
}

type Collection_AddBookToCollectionParams

type Collection_AddBookToCollectionParams struct {
	BookID       int64
	CollectionID int64
}

type Collection_DeleteBookFromCollectionParams

type Collection_DeleteBookFromCollectionParams struct {
	BookID       int64
	CollectionID int64
}

type Collection_GetBooksParams

type Collection_GetBooksParams struct {
	Limit        int32
	Offset       int32
	CollectionID int64
}

type Collection_GetBooksRow

type Collection_GetBooksRow struct {
	ID                    int64
	Name                  string
	Slug                  string
	Summary               string
	AuthorUserID          pgtype.UUID
	CreatedAt             pgtype.Timestamptz
	AgeRating             AgeRating
	IsPubliclyVisible     bool
	IsBanned              bool
	IsTrashed             bool
	Words                 int32
	Chapters              int32
	TagIds                []int64
	CachedParentTagIds    []int64
	Cover                 string
	View                  int32
	Rating                pgtype.Float8
	TotalReviews          int32
	TotalRatings          int32
	IsPinned              bool
	IsPermRemoved         bool
	IsShadowBanned        bool
	AuthorName            string
	OrderWithinCollection int32
}

type Collection_GetByBookParams

type Collection_GetByBookParams struct {
	UserID pgtype.UUID
	BookID int64
}

type Collection_GetByBookRow

type Collection_GetByBookRow struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
	UserName      string
}

type Collection_GetByUserParams

type Collection_GetByUserParams struct {
	Limit  int32
	Offset int32
	UserID pgtype.UUID
}

type Collection_GetByUserRow

type Collection_GetByUserRow struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
	UserName      string
}

type Collection_GetRecentByUserParams

type Collection_GetRecentByUserParams struct {
	UserID pgtype.UUID
	Limit  int32
}

type Collection_GetRow

type Collection_GetRow struct {
	ID            int64
	Name          string
	Slug          string
	Summary       string
	UserID        pgtype.UUID
	CreatedAt     pgtype.Timestamptz
	BooksCount    int32
	LastUpdatedAt pgtype.Timestamptz
	IsPublic      bool
	UserName      string
}

type Collection_InsertParams

type Collection_InsertParams struct {
	ID     int64
	Name   string
	Slug   string
	UserID pgtype.UUID
}

type Collection_UpdateParams

type Collection_UpdateParams struct {
	ID      int64
	Name    string
	Summary string
	Slug    string
}

type Comment

type Comment struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
}

type Comment_GetByChapterAfterParams

type Comment_GetByChapterAfterParams struct {
	ChapterID int64
	Limit     int32
	CreatedAt pgtype.Timestamptz
}

type Comment_GetByChapterAfterRow

type Comment_GetByChapterAfterRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetByChapterParams

type Comment_GetByChapterParams struct {
	ChapterID int64
	Limit     int32
}

type Comment_GetByChapterRow

type Comment_GetByChapterRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetChildCommentsAfterParams

type Comment_GetChildCommentsAfterParams struct {
	Limit     int32
	CreatedAt pgtype.Timestamptz
	ParentID  int64
}

type Comment_GetChildCommentsAfterRow

type Comment_GetChildCommentsAfterRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetChildCommentsParams

type Comment_GetChildCommentsParams struct {
	Limit    int32
	ParentID int64
}

type Comment_GetChildCommentsRow

type Comment_GetChildCommentsRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_GetLikedCommentsParams

type Comment_GetLikedCommentsParams struct {
	UserID pgtype.UUID
	Ids    []int64
}

type Comment_GetLikedCommentsRow

type Comment_GetLikedCommentsRow struct {
	CommentID int64
	LikedAt   pgtype.Timestamptz
}

type Comment_GetWithUserByIDRow

type Comment_GetWithUserByIDRow struct {
	ID                  int64
	ChapterID           int64
	UserID              pgtype.UUID
	Content             string
	CreatedAt           pgtype.Timestamptz
	UpdatedAt           pgtype.Timestamptz
	DeletedAt           pgtype.Timestamptz
	ParentID            pgtype.Int8
	Subcomments         int32
	Likes               int32
	LikesRecalculatedAt pgtype.Timestamptz
	UserName            string
}

type Comment_InsertParams

type Comment_InsertParams struct {
	ID        int64
	ChapterID int64
	ParentID  pgtype.Int8
	UserID    pgtype.UUID
	Content   string
}

type Comment_LikeParams

type Comment_LikeParams struct {
	CommentID int64
	UserID    pgtype.UUID
}

type Comment_UnLikeParams

type Comment_UnLikeParams struct {
	CommentID int64
	UserID    pgtype.UUID
}

type Comment_UpdateParams

type Comment_UpdateParams struct {
	ID      int64
	Content string
}

type CommentsLiked

type CommentsLiked struct {
	CommentID int64
	UserID    pgtype.UUID
	LikedAt   pgtype.Timestamptz
}

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 DefinedTag

type DefinedTag struct {
	ID             int64
	Name           string
	Description    string
	IsSpoiler      bool
	IsAdult        bool
	CreatedAt      pgtype.Timestamptz
	TagType        TagType
	SynonymOf      pgtype.Int8
	IsDefault      bool
	LowercasedName string
}

type DeleteRateParams

type DeleteRateParams struct {
	BookID int64
	UserID pgtype.UUID
}

type DeleteReviewParams

type DeleteReviewParams struct {
	UserID pgtype.UUID
	BookID int64
}

type DeleteUserFollowParams

type DeleteUserFollowParams struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
}

type Draft

type Draft struct {
	ID              int64
	CreatedBy       pgtype.UUID
	ChapterID       int64
	ChapterName     string
	Content         string
	Words           int32
	Summary         string
	IsAdultOverride bool
	UpdatedAt       pgtype.Timestamptz
	CreatedAt       pgtype.Timestamptz
	PublishedAt     pgtype.Timestamptz
}

type DraftLog

type DraftLog struct {
	ID        int64
	DraftID   int64
	CreatedAt pgtype.Timestamptz
	UserID    pgtype.UUID
	Payload   []byte
}

type Draft_GetByIdRow

type Draft_GetByIdRow struct {
	ID                       int64
	CreatedBy                pgtype.UUID
	ChapterID                int64
	ChapterName              string
	Content                  string
	Words                    int32
	Summary                  string
	IsAdultOverride          bool
	UpdatedAt                pgtype.Timestamptz
	CreatedAt                pgtype.Timestamptz
	PublishedAt              pgtype.Timestamptz
	BookID                   int64
	BookName                 string
	IsChapterPubliclyVisible bool
	ChapterContentUpdatedAt  pgtype.Timestamptz
}

type Draft_InsertParams

type Draft_InsertParams struct {
	ID          int64
	CreatedBy   pgtype.UUID
	ChapterID   int64
	ChapterName string
	Content     string
	UpdatedAt   pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
}

type Draft_UpdateChapterNameParams

type Draft_UpdateChapterNameParams struct {
	ID          int64
	ChapterName string
}

type Draft_UpdateContentParams

type Draft_UpdateContentParams struct {
	ID      int64
	Content string
	Words   int32
}

type Draft_UpdateParams

type Draft_UpdateParams struct {
	ID              int64
	ChapterName     string
	IsAdultOverride bool
	Words           int32
	Content         string
	Summary         string
}

type EmailVerification

type EmailVerification struct {
	Email                string
	UserID               pgtype.UUID
	VerificationCodeHash string
	CreatedAt            pgtype.Timestamptz
	ValidThrough         pgtype.Timestamptz
}

type EmailVerification_InsertParams

type EmailVerification_InsertParams struct {
	Email                string
	UserID               pgtype.UUID
	ValidThrough         pgtype.Timestamptz
	VerificationCodeHash string
}

type GetAllBookChaptersRow

type GetAllBookChaptersRow struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	ContentUpdatedAt  pgtype.Timestamptz
	Order             int32
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	IsAdultOverride   bool
	Summary           string
	IsPubliclyVisible bool
	LatestDraftID     int64
}

type GetAllBooksParams

type GetAllBooksParams struct {
	ID    int64
	Limit int32
}

type GetAllBooksRow

type GetAllBooksRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	CachedParentTagIds []int64
	IsPubliclyVisible  bool
	IsTrashed          bool
	Chapters           int32
	Words              int32
}

type GetBookChapterWithDetailsParams

type GetBookChapterWithDetailsParams struct {
	ID     int64
	BookID int64
}

type GetBookChapterWithDetailsRow

type GetBookChapterWithDetailsRow struct {
	ID                int64
	Name              string
	BookID            int64
	Content           string
	ContentUpdatedAt  pgtype.Timestamptz
	Order             int32
	CreatedAt         pgtype.Timestamptz
	UpdatedAt         pgtype.Timestamptz
	Words             int32
	IsAdultOverride   bool
	Summary           string
	IsPubliclyVisible bool
	PrevChapterID     int64
	PrevChapterName   string
	NextChapterID     int64
	NextChapterName   string
}

type GetBookCollectionDataRow

type GetBookCollectionDataRow struct {
	ID        int64
	Name      string
	Size      int32
	Position  int32
	CreatedAt pgtype.Timestamptz
	UserName  string
	UserID    pgtype.UUID
}

type GetBookReadingListStateParams

type GetBookReadingListStateParams struct {
	BookID int64
	UserID pgtype.UUID
}

type GetBookReadingListStateRow

type GetBookReadingListStateRow struct {
	UserID                pgtype.UUID
	BookID                int64
	Status                ReadingListStatus
	LastAccessedChapterID pgtype.Int8
	LastUpdatedAt         pgtype.Timestamptz
	ChapterOrder          pgtype.Int4
	ChapterName           pgtype.Text
}

type GetBookReviewsDistributionRow

type GetBookReviewsDistributionRow struct {
	Rating int16
	Count  int64
}

type GetBookReviewsParams

type GetBookReviewsParams struct {
	BookID int64
	Offset int32
	Limit  int32
}

type GetBookReviewsRow

type GetBookReviewsRow struct {
	UserID          pgtype.UUID
	BookID          int64
	Content         string
	CreatedAt       pgtype.Timestamptz
	LastUpdatedAt   pgtype.Timestamptz
	Likes           int32
	Rating          int16
	RatingUpdatedAt pgtype.Timestamptz
	UserName        string
}

type GetBookRow

type GetBookRow struct {
	ID                 int64
	Name               string
	Slug               string
	Summary            string
	AuthorUserID       pgtype.UUID
	CreatedAt          pgtype.Timestamptz
	AgeRating          AgeRating
	IsPubliclyVisible  bool
	IsBanned           bool
	IsTrashed          bool
	Words              int32
	Chapters           int32
	TagIds             []int64
	CachedParentTagIds []int64
	Cover              string
	View               int32
	Rating             pgtype.Float8
	TotalReviews       int32
	TotalRatings       int32
	IsPinned           bool
	IsPermRemoved      bool
	IsShadowBanned     bool
	AuthorName         string
}

type GetBookSearchRelatedDataRow

type GetBookSearchRelatedDataRow struct {
	CreatedAt pgtype.Timestamptz
	Cover     string
	ID        int64
}

type GetBooksCollectionDataRow

type GetBooksCollectionDataRow struct {
	ID        int64
	Name      string
	Size      int32
	BookID    int64
	Position  int32
	CreatedAt pgtype.Timestamptz
	UserName  string
	UserID    pgtype.UUID
}

type GetRateParams

type GetRateParams struct {
	BookID int64
	UserID pgtype.UUID
}

type GetRatingParams

type GetRatingParams struct {
	UserID pgtype.UUID
	BookID int64
}

type GetReviewAndRatingParams

type GetReviewAndRatingParams struct {
	UserID pgtype.UUID
	BookID int64
}

type GetReviewAndRatingRow

type GetReviewAndRatingRow struct {
	UserID          pgtype.UUID
	BookID          int64
	Content         string
	CreatedAt       pgtype.Timestamptz
	LastUpdatedAt   pgtype.Timestamptz
	Likes           int32
	Rating          int16
	RatingUpdatedAt pgtype.Timestamptz
}

type GetReviewParams

type GetReviewParams struct {
	UserID pgtype.UUID
	BookID int64
}

type GetTagRow

type GetTagRow struct {
	ID             int64
	Name           string
	Description    string
	IsSpoiler      bool
	IsAdult        bool
	CreatedAt      pgtype.Timestamptz
	TagType        TagType
	SynonymOf      pgtype.Int8
	IsDefault      bool
	LowercasedName string
	SynonymName    pgtype.Text
}

type GetTopUserBooksParams

type GetTopUserBooksParams struct {
	AuthorUserID pgtype.UUID
	Limit        int32
}

type GetUserLibraryParams

type GetUserLibraryParams struct {
	UserID pgtype.UUID
	Status ReadingListStatus
	Limit  int32
}

type GetUserLibraryRow

type GetUserLibraryRow struct {
	ID            int64
	Name          string
	Cover         string
	AgeRating     AgeRating
	LastUpdatedAt pgtype.Timestamptz
	ChapterOrder  pgtype.Int4
	ChapterName   pgtype.Text
	ChapterID     pgtype.Int8
}

type GetUserPrivacySettingsRow

type GetUserPrivacySettingsRow struct {
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
}

type InsertDefinedTagEnMasseParams

type InsertDefinedTagEnMasseParams struct {
	ID          int64
	Name        string
	Description string
	IsSpoiler   bool
	IsAdult     bool
	CreatedAt   pgtype.Timestamptz
	TagType     TagType
	SynonymOf   pgtype.Int8
}

type InsertDefinedTagParams

type InsertDefinedTagParams struct {
	ID          int64
	Name        string
	Description string
	IsSpoiler   bool
	IsAdult     bool
	CreatedAt   pgtype.Timestamptz
	TagType     TagType
	SynonymOf   pgtype.Int8
}

type InsertOrUpdateRateParams

type InsertOrUpdateRateParams struct {
	BookID int64
	UserID pgtype.UUID
	Rating int16
}

type InsertOrUpdateReviewParams

type InsertOrUpdateReviewParams struct {
	UserID  pgtype.UUID
	BookID  int64
	Content string
}

type Int4Range

type Int4Range struct {
	Min pgtype.Int4
	Max pgtype.Int4
}

type ListTagsQuery

type ListTagsQuery struct {
	Query          string
	OnlyParentTags bool
	OnlyAdultTags  bool
	Limit          uint
	Offset         uint
}

type ModAddBookLogParams

type ModAddBookLogParams struct {
	ID          int64
	Time        pgtype.Timestamptz
	BookID      int64
	ActionType  BookActionType
	Payload     []byte
	ActorUserID pgtype.UUID
	Reason      string
}

type ModCountBookLogFilteredParams

type ModCountBookLogFilteredParams struct {
	BookID      int64
	ActionTypes []BookActionType
}

type ModGetBookInfoRow

type ModGetBookInfoRow struct {
	IsBanned       bool
	IsShadowBanned bool
	IsPermRemoved  bool
	Name           string
	Summary        string
}

type ModGetBookLogFilteredParams

type ModGetBookLogFilteredParams struct {
	BookID      int64
	Limit       int32
	Offset      int32
	ActionTypes []BookActionType
}

type ModGetBookLogFilteredRow

type ModGetBookLogFilteredRow struct {
	ID            int64
	Time          pgtype.Timestamptz
	BookID        int64
	ActionType    BookActionType
	Payload       []byte
	ActorUserID   pgtype.UUID
	Reason        string
	ActorUserName string
}

type ModGetBookLogOfTypeParams

type ModGetBookLogOfTypeParams struct {
	BookID     int64
	Limit      int32
	Offset     int32
	ActionType BookActionType
}

type ModGetBookLogParams

type ModGetBookLogParams struct {
	BookID int64
	Limit  int32
	Offset int32
}

type ModGetBookModStateRow

type ModGetBookModStateRow struct {
	ID             int64
	IsBanned       bool
	IsShadowBanned bool
}

type ModPermRemoveBookParams

type ModPermRemoveBookParams struct {
	ID           int64
	AuthorUserID pgtype.UUID
}

type ModSetBookBannedParams

type ModSetBookBannedParams struct {
	IsBanned bool
	ID       int64
}

type ModSetBookShadowBannedParams

type ModSetBookShadowBannedParams struct {
	IsShadowBanned bool
	ID             int64
}

type NullAgeRating

type NullAgeRating struct {
	AgeRating AgeRating
	Valid     bool // Valid is true if AgeRating is not NULL
}

func (*NullAgeRating) Scan

func (ns *NullAgeRating) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAgeRating) Value

func (ns NullAgeRating) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullBookActionType

type NullBookActionType struct {
	BookActionType BookActionType
	Valid          bool // Valid is true if BookActionType is not NULL
}

func (*NullBookActionType) Scan

func (ns *NullBookActionType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullBookActionType) Value

func (ns NullBookActionType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullCensorMode

type NullCensorMode struct {
	CensorMode CensorMode
	Valid      bool // Valid is true if CensorMode is not NULL
}

func (*NullCensorMode) Scan

func (ns *NullCensorMode) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullCensorMode) Value

func (ns NullCensorMode) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullReadingListStatus

type NullReadingListStatus struct {
	ReadingListStatus ReadingListStatus
	Valid             bool // Valid is true if ReadingListStatus is not NULL
}

func (*NullReadingListStatus) Scan

func (ns *NullReadingListStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullReadingListStatus) Value

func (ns NullReadingListStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTagType

type NullTagType struct {
	TagType TagType
	Valid   bool // Valid is true if TagType is not NULL
}

func (*NullTagType) Scan

func (ns *NullTagType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTagType) Value

func (ns NullTagType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullTypeOf2fa

type NullTypeOf2fa struct {
	TypeOf2fa TypeOf2fa
	Valid     bool // Valid is true if TypeOf2fa is not NULL
}

func (*NullTypeOf2fa) Scan

func (ns *NullTypeOf2fa) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTypeOf2fa) Value

func (ns NullTypeOf2fa) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUserActionType

type NullUserActionType struct {
	UserActionType UserActionType
	Valid          bool // Valid is true if UserActionType is not NULL
}

func (*NullUserActionType) Scan

func (ns *NullUserActionType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUserActionType) Value

func (ns NullUserActionType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUserRole

type NullUserRole struct {
	UserRole UserRole
	Valid    bool // Valid is true if UserRole is not NULL
}

func (*NullUserRole) Scan

func (ns *NullUserRole) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUserRole) Value

func (ns NullUserRole) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OlAnalyticsViewCounter

type OlAnalyticsViewCounter struct {
	Period     int32
	EntityType int16
	EntityID   int64
	BookID     int64
	ViewCount  int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Analytics_GetChapterViews

func (q *Queries) Analytics_GetChapterViews(ctx context.Context, arg Analytics_GetChapterViewsParams) ([]Analytics_GetChapterViewsRow, error)

func (*Queries) Analytics_GetTotalViews

func (q *Queries) Analytics_GetTotalViews(ctx context.Context, bookID int64) (int64, error)

func (*Queries) Analytics_GetViews

func (q *Queries) Analytics_GetViews(ctx context.Context, arg Analytics_GetViewsParams) ([]Analytics_GetViewsRow, error)

func (*Queries) Analytics_IncrView

func (q *Queries) Analytics_IncrView(ctx context.Context, arg Analytics_IncrViewParams) error

func (*Queries) BookSetCover

func (q *Queries) BookSetCover(ctx context.Context, arg BookSetCoverParams) error

func (*Queries) Book_Book_ManagerGetUserBooksCount

func (q *Queries) Book_Book_ManagerGetUserBooksCount(ctx context.Context, arg Book_Book_ManagerGetUserBooksCountParams) (int64, error)

func (*Queries) Book_GetByIds

func (q *Queries) Book_GetByIds(ctx context.Context, ids []int64) ([]Book, error)

func (*Queries) Book_GetByUser

func (q *Queries) Book_GetByUser(ctx context.Context, arg Book_GetByUserParams) ([]Book, error)

func (*Queries) Book_GetChapterOrder

func (q *Queries) Book_GetChapterOrder(ctx context.Context, bookID int64) ([]Book_GetChapterOrderRow, error)

func (*Queries) Book_GetFirstChapterID

func (q *Queries) Book_GetFirstChapterID(ctx context.Context, bookID int64) (int64, error)

func (*Queries) Book_GetLastChapterOrder

func (q *Queries) Book_GetLastChapterOrder(ctx context.Context, bookID int64) (int32, error)

func (*Queries) Book_GetPubliclyVisibleChapters

func (q *Queries) Book_GetPubliclyVisibleChapters(ctx context.Context, bookID int64) ([]Book_GetPubliclyVisibleChaptersRow, error)

func (*Queries) Book_Insert

func (q *Queries) Book_Insert(ctx context.Context, arg Book_InsertParams) error

func (*Queries) Book_InsertChapter

func (q *Queries) Book_InsertChapter(ctx context.Context, arg Book_InsertChapterParams) error

func (*Queries) Book_ManagerGetUserBooks

func (q *Queries) Book_ManagerGetUserBooks(ctx context.Context, arg Book_ManagerGetUserBooksParams) ([]Book_ManagerGetUserBooksRow, error)

func (*Queries) Book_SetChapterOrder

func (q *Queries) Book_SetChapterOrder(ctx context.Context, arg Book_SetChapterOrderParams) error

func (*Queries) Book_Trash

func (q *Queries) Book_Trash(ctx context.Context, id int64) error

func (*Queries) Book_UnTrash

func (q *Queries) Book_UnTrash(ctx context.Context, arg Book_UnTrashParams) error

func (*Queries) Chapter_Update

func (q *Queries) Chapter_Update(ctx context.Context, arg Chapter_UpdateParams) (int64, error)

func (*Queries) Collection_AddBookToCollection

func (q *Queries) Collection_AddBookToCollection(ctx context.Context, arg Collection_AddBookToCollectionParams) error

func (*Queries) Collection_CountBooks

func (q *Queries) Collection_CountBooks(ctx context.Context, collectionID int64) (int64, error)

func (*Queries) Collection_CountByUser

func (q *Queries) Collection_CountByUser(ctx context.Context, userID pgtype.UUID) (int64, error)

func (*Queries) Collection_Delete

func (q *Queries) Collection_Delete(ctx context.Context, id int64) error

func (*Queries) Collection_DeleteAllBooks

func (q *Queries) Collection_DeleteAllBooks(ctx context.Context, collectionID int64) error

func (*Queries) Collection_DeleteBookFromCollection

func (q *Queries) Collection_DeleteBookFromCollection(ctx context.Context, arg Collection_DeleteBookFromCollectionParams) error

func (*Queries) Collection_Get

func (q *Queries) Collection_Get(ctx context.Context, id int64) (Collection_GetRow, error)

func (*Queries) Collection_GetBooks

func (q *Queries) Collection_GetBooks(ctx context.Context, arg Collection_GetBooksParams) ([]Collection_GetBooksRow, error)

func (*Queries) Collection_GetByBook

func (q *Queries) Collection_GetByBook(ctx context.Context, arg Collection_GetByBookParams) ([]Collection_GetByBookRow, error)

func (*Queries) Collection_GetByUser

func (q *Queries) Collection_GetByUser(ctx context.Context, arg Collection_GetByUserParams) ([]Collection_GetByUserRow, error)

func (*Queries) Collection_GetMaxOrder

func (q *Queries) Collection_GetMaxOrder(ctx context.Context, collectionID int64) (int32, error)

func (*Queries) Collection_GetRecentByUser

func (q *Queries) Collection_GetRecentByUser(ctx context.Context, arg Collection_GetRecentByUserParams) ([]Collection, error)

func (*Queries) Collection_Insert

func (q *Queries) Collection_Insert(ctx context.Context, arg Collection_InsertParams) error

func (*Queries) Collection_RecalculateCounter

func (q *Queries) Collection_RecalculateCounter(ctx context.Context, collectionID int64) error

func (*Queries) Collection_Update

func (q *Queries) Collection_Update(ctx context.Context, arg Collection_UpdateParams) error

func (*Queries) Collections_ListByID

func (q *Queries) Collections_ListByID(ctx context.Context, dollar_1 []int64) ([]Collection, error)

func (*Queries) Comment_GetByChapter

func (q *Queries) Comment_GetByChapter(ctx context.Context, arg Comment_GetByChapterParams) ([]Comment_GetByChapterRow, error)

func (*Queries) Comment_GetByChapterAfter

func (q *Queries) Comment_GetByChapterAfter(ctx context.Context, arg Comment_GetByChapterAfterParams) ([]Comment_GetByChapterAfterRow, error)

func (*Queries) Comment_GetByID

func (q *Queries) Comment_GetByID(ctx context.Context, id int64) (Comment, error)

func (*Queries) Comment_GetChildComments

func (q *Queries) Comment_GetChildComments(ctx context.Context, arg Comment_GetChildCommentsParams) ([]Comment_GetChildCommentsRow, error)

func (*Queries) Comment_GetLikedComments

func (q *Queries) Comment_GetLikedComments(ctx context.Context, arg Comment_GetLikedCommentsParams) ([]Comment_GetLikedCommentsRow, error)

func (*Queries) Comment_GetWithUserByID

func (q *Queries) Comment_GetWithUserByID(ctx context.Context, id int64) (Comment_GetWithUserByIDRow, error)

func (*Queries) Comment_Insert

func (q *Queries) Comment_Insert(ctx context.Context, arg Comment_InsertParams) error

func (*Queries) Comment_Like

func (q *Queries) Comment_Like(ctx context.Context, arg Comment_LikeParams) error

func (*Queries) Comment_RecalculateSubcomments

func (q *Queries) Comment_RecalculateSubcomments(ctx context.Context, id pgtype.Int8) error

func (*Queries) Comment_UnLike

func (q *Queries) Comment_UnLike(ctx context.Context, arg Comment_UnLikeParams) error

func (*Queries) Comment_Update

func (q *Queries) Comment_Update(ctx context.Context, arg Comment_UpdateParams) (pgconn.CommandTag, error)

func (*Queries) DefinedTagsAreInitialized

func (q *Queries) DefinedTagsAreInitialized(ctx context.Context) (bool, error)

func (*Queries) DeleteInactive2FADevices

func (q *Queries) DeleteInactive2FADevices(ctx context.Context, createdAt pgtype.Timestamptz) error

func (*Queries) DeleteRate

func (q *Queries) DeleteRate(ctx context.Context, arg DeleteRateParams) error

func (*Queries) DeleteReview

func (q *Queries) DeleteReview(ctx context.Context, arg DeleteReviewParams) error

func (*Queries) DeleteUserFollow

func (q *Queries) DeleteUserFollow(ctx context.Context, arg DeleteUserFollowParams) error

func (*Queries) Draft_Delete

func (q *Queries) Draft_Delete(ctx context.Context, id int64) error

func (*Queries) Draft_GetById

func (q *Queries) Draft_GetById(ctx context.Context, id int64) (Draft_GetByIdRow, error)

func (*Queries) Draft_GetLatestID

func (q *Queries) Draft_GetLatestID(ctx context.Context, chapterID int64) (int64, error)

func (*Queries) Draft_Insert

func (q *Queries) Draft_Insert(ctx context.Context, arg Draft_InsertParams) error

func (*Queries) Draft_MarkAsPublished

func (q *Queries) Draft_MarkAsPublished(ctx context.Context, id int64) error

func (*Queries) Draft_Update

func (q *Queries) Draft_Update(ctx context.Context, arg Draft_UpdateParams) error

func (*Queries) Draft_UpdateChapterName

func (q *Queries) Draft_UpdateChapterName(ctx context.Context, arg Draft_UpdateChapterNameParams) error

func (*Queries) Draft_UpdateContent

func (q *Queries) Draft_UpdateContent(ctx context.Context, arg Draft_UpdateContentParams) error

func (*Queries) EmailVerification_Delete

func (q *Queries) EmailVerification_Delete(ctx context.Context, email string) error

func (*Queries) EmailVerification_Get

func (q *Queries) EmailVerification_Get(ctx context.Context, email string) (EmailVerification, error)

func (*Queries) EmailVerification_Insert

func (q *Queries) EmailVerification_Insert(ctx context.Context, arg EmailVerification_InsertParams) error

func (*Queries) GetAllBookChapters

func (q *Queries) GetAllBookChapters(ctx context.Context, bookID int64) ([]GetAllBookChaptersRow, error)

func (*Queries) GetAllBooks

func (q *Queries) GetAllBooks(ctx context.Context, arg GetAllBooksParams) ([]GetAllBooksRow, error)

func (*Queries) GetBook

func (q *Queries) GetBook(ctx context.Context, id int64) (GetBookRow, error)

func (*Queries) GetBookCollectionData

func (q *Queries) GetBookCollectionData(ctx context.Context, bookID int64) ([]GetBookCollectionDataRow, error)

func (*Queries) GetBookReadingListState

func (q *Queries) GetBookReadingListState(ctx context.Context, arg GetBookReadingListStateParams) (GetBookReadingListStateRow, error)

func (*Queries) GetBookReviews

func (q *Queries) GetBookReviews(ctx context.Context, arg GetBookReviewsParams) ([]GetBookReviewsRow, error)

func (*Queries) GetBookReviewsDistribution

func (q *Queries) GetBookReviewsDistribution(ctx context.Context, bookID int64) ([]GetBookReviewsDistributionRow, error)

func (*Queries) GetBookSearchRelatedData

func (q *Queries) GetBookSearchRelatedData(ctx context.Context, ids []int64) ([]GetBookSearchRelatedDataRow, error)

func (*Queries) GetBooksCollectionData

func (q *Queries) GetBooksCollectionData(ctx context.Context, dollar_1 []int64) ([]GetBooksCollectionDataRow, error)

func (*Queries) GetChapterBookID

func (q *Queries) GetChapterBookID(ctx context.Context, id int64) (int64, error)

func (*Queries) GetChaptersOrder

func (q *Queries) GetChaptersOrder(ctx context.Context, bookID int64) ([]int64, error)

func (*Queries) GetFirstChapterID

func (q *Queries) GetFirstChapterID(ctx context.Context, bookID int64) (int64, error)

func (*Queries) GetLastChapterID

func (q *Queries) GetLastChapterID(ctx context.Context, bookID int64) (int64, error)

func (*Queries) GetRandomPublicBookIDs

func (q *Queries) GetRandomPublicBookIDs(ctx context.Context, limit int32) ([]int64, error)

func (*Queries) GetRate

func (q *Queries) GetRate(ctx context.Context, arg GetRateParams) (int16, error)

func (*Queries) GetRating

func (q *Queries) GetRating(ctx context.Context, arg GetRatingParams) (Rating, error)

func (*Queries) GetReview

func (q *Queries) GetReview(ctx context.Context, arg GetReviewParams) (Review, error)

func (*Queries) GetReviewAndRating

func (q *Queries) GetReviewAndRating(ctx context.Context, arg GetReviewAndRatingParams) (GetReviewAndRatingRow, error)

func (*Queries) GetTag

func (q *Queries) GetTag(ctx context.Context, id int64) (GetTagRow, error)

func (*Queries) GetTagParent

func (q *Queries) GetTagParent(ctx context.Context, id int64) (DefinedTag, error)

func (*Queries) GetTagsByIds

func (q *Queries) GetTagsByIds(ctx context.Context, ids []int64) ([]DefinedTag, error)

func (*Queries) GetTagsByName

func (q *Queries) GetTagsByName(ctx context.Context, names []string) ([]DefinedTag, error)

func (*Queries) GetTopUserBooks

func (q *Queries) GetTopUserBooks(ctx context.Context, arg GetTopUserBooksParams) ([]Book, error)

func (*Queries) GetUserLibrary

func (q *Queries) GetUserLibrary(ctx context.Context, arg GetUserLibraryParams) ([]GetUserLibraryRow, error)

func (*Queries) GetUserPrivacySettings

func (q *Queries) GetUserPrivacySettings(ctx context.Context, id pgtype.UUID) (GetUserPrivacySettingsRow, error)

func (*Queries) ImportTags

func (q *Queries) ImportTags(ctx context.Context, dollar_1 []byte) error

func (*Queries) InsertDefinedTag

func (q *Queries) InsertDefinedTag(ctx context.Context, arg InsertDefinedTagParams) error

func (*Queries) InsertDefinedTagEnMasse

func (q *Queries) InsertDefinedTagEnMasse(ctx context.Context, arg []InsertDefinedTagEnMasseParams) (int64, error)

func (*Queries) InsertOrUpdateRate

func (q *Queries) InsertOrUpdateRate(ctx context.Context, arg InsertOrUpdateRateParams) error

func (*Queries) InsertOrUpdateReview

func (q *Queries) InsertOrUpdateReview(ctx context.Context, arg InsertOrUpdateReviewParams) (Review, error)

func (*Queries) ModAddBookLog

func (q *Queries) ModAddBookLog(ctx context.Context, arg ModAddBookLogParams) error

func (*Queries) ModCountBookLogFiltered

func (q *Queries) ModCountBookLogFiltered(ctx context.Context, arg ModCountBookLogFilteredParams) (int64, error)

func (*Queries) ModGetBookInfo

func (q *Queries) ModGetBookInfo(ctx context.Context, id int64) (ModGetBookInfoRow, error)

func (*Queries) ModGetBookLog

func (q *Queries) ModGetBookLog(ctx context.Context, arg ModGetBookLogParams) ([]BookLog, error)

func (*Queries) ModGetBookLogFiltered

func (q *Queries) ModGetBookLogFiltered(ctx context.Context, arg ModGetBookLogFilteredParams) ([]ModGetBookLogFilteredRow, error)

func (*Queries) ModGetBookLogOfType

func (q *Queries) ModGetBookLogOfType(ctx context.Context, arg ModGetBookLogOfTypeParams) ([]BookLog, error)

func (*Queries) ModGetBookModState

func (q *Queries) ModGetBookModState(ctx context.Context, id int64) (ModGetBookModStateRow, error)

func (*Queries) ModPermRemoveBook

func (q *Queries) ModPermRemoveBook(ctx context.Context, arg ModPermRemoveBookParams) error

func (*Queries) ModSetBookBanned

func (q *Queries) ModSetBookBanned(ctx context.Context, arg ModSetBookBannedParams) error

func (*Queries) ModSetBookShadowBanned

func (q *Queries) ModSetBookShadowBanned(ctx context.Context, arg ModSetBookShadowBannedParams) error

func (*Queries) RecalculateBookRating

func (q *Queries) RecalculateBookRating(ctx context.Context, bookID int64) error

func (*Queries) RecalculateBookStats

func (q *Queries) RecalculateBookStats(ctx context.Context, id int64) error

func (*Queries) RemoveUnusedDefaultTags

func (q *Queries) RemoveUnusedDefaultTags(ctx context.Context, names []string) error

func (*Queries) SearchDefinedTags

func (q *Queries) SearchDefinedTags(ctx context.Context, arg SearchDefinedTagsParams) ([]DefinedTag, error)

func (*Queries) SearchDefinedTagsWithType

func (q *Queries) SearchDefinedTagsWithType(ctx context.Context, arg SearchDefinedTagsWithTypeParams) ([]DefinedTag, error)

func (*Queries) Session_GetInfo

func (q *Queries) Session_GetInfo(ctx context.Context, sid string) (Session_GetInfoRow, error)

func (*Queries) Session_GetUserSessions

func (q *Queries) Session_GetUserSessions(ctx context.Context, userID pgtype.UUID) ([]Session_GetUserSessionsRow, error)

func (*Queries) Session_Insert

func (q *Queries) Session_Insert(ctx context.Context, arg Session_InsertParams) error

func (*Queries) Session_Terminate

func (q *Queries) Session_Terminate(ctx context.Context, sid string) error

func (*Queries) Session_TerminateAllByUserID

func (q *Queries) Session_TerminateAllByUserID(ctx context.Context, userID pgtype.UUID) error

func (*Queries) SetBookReadingListChapter

func (q *Queries) SetBookReadingListChapter(ctx context.Context, arg SetBookReadingListChapterParams) error

func (*Queries) SetBookReadingListStatus

func (q *Queries) SetBookReadingListStatus(ctx context.Context, arg SetBookReadingListStatusParams) (ReadingList, error)

func (*Queries) SetBookReadingListStatusAndChapter

func (q *Queries) SetBookReadingListStatusAndChapter(ctx context.Context, arg SetBookReadingListStatusAndChapterParams) (ReadingList, error)

func (*Queries) SiteConfig_Get

func (q *Queries) SiteConfig_Get(ctx context.Context) ([]byte, error)

func (*Queries) SiteConfig_Set

func (q *Queries) SiteConfig_Set(ctx context.Context, value []byte) error

func (*Queries) UpdateBook

func (q *Queries) UpdateBook(ctx context.Context, arg UpdateBookParams) error

func (*Queries) UpdateTag

func (q *Queries) UpdateTag(ctx context.Context, arg UpdateTagParams) error

func (*Queries) User_ExistsByEmail

func (q *Queries) User_ExistsByEmail(ctx context.Context, email string) (bool, error)

func (*Queries) User_ExistsByUsername

func (q *Queries) User_ExistsByUsername(ctx context.Context, name string) (bool, error)

func (*Queries) User_FindByLogin

func (q *Queries) User_FindByLogin(ctx context.Context, name string) (User, error)

func (*Queries) User_Get

func (q *Queries) User_Get(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) User_Get2FADevices

func (q *Queries) User_Get2FADevices(ctx context.Context, userID pgtype.UUID) ([]User2fa, error)

func (*Queries) User_GetAboutSettings

func (q *Queries) User_GetAboutSettings(ctx context.Context, id pgtype.UUID) (User_GetAboutSettingsRow, error)

func (*Queries) User_GetCustomizationSettings

func (q *Queries) User_GetCustomizationSettings(ctx context.Context, id pgtype.UUID) (User_GetCustomizationSettingsRow, error)

func (*Queries) User_GetDetails

func (q *Queries) User_GetDetails(ctx context.Context, arg User_GetDetailsParams) (User_GetDetailsRow, error)

func (*Queries) User_GetModerationSettings

func (q *Queries) User_GetModerationSettings(ctx context.Context, id pgtype.UUID) (User_GetModerationSettingsRow, error)

func (*Queries) User_GetNames

func (q *Queries) User_GetNames(ctx context.Context, ids []pgtype.UUID) ([]User_GetNamesRow, error)

func (*Queries) User_Insert

func (q *Queries) User_Insert(ctx context.Context, arg User_InsertParams) error

func (*Queries) User_InsertFollow

func (q *Queries) User_InsertFollow(ctx context.Context, arg User_InsertFollowParams) error

func (*Queries) User_IsFollowing

func (q *Queries) User_IsFollowing(ctx context.Context, arg User_IsFollowingParams) (bool, error)

func (*Queries) User_SetEmailVerified

func (q *Queries) User_SetEmailVerified(ctx context.Context, arg User_SetEmailVerifiedParams) error

func (*Queries) User_UpdateAboutSettings

func (q *Queries) User_UpdateAboutSettings(ctx context.Context, arg User_UpdateAboutSettingsParams) error

func (*Queries) User_UpdateCustomizationSettings

func (q *Queries) User_UpdateCustomizationSettings(ctx context.Context, arg User_UpdateCustomizationSettingsParams) error

func (*Queries) User_UpdateModerationSettings

func (q *Queries) User_UpdateModerationSettings(ctx context.Context, arg User_UpdateModerationSettingsParams) error

func (*Queries) User_UpdatePassword

func (q *Queries) User_UpdatePassword(ctx context.Context, arg User_UpdatePasswordParams) error

func (*Queries) User_UpdatePrivacySettings

func (q *Queries) User_UpdatePrivacySettings(ctx context.Context, arg User_UpdatePrivacySettingsParams) error

func (*Queries) User_UpdateRole

func (q *Queries) User_UpdateRole(ctx context.Context, arg User_UpdateRoleParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Rating

type Rating struct {
	UserID    pgtype.UUID
	BookID    int64
	Rating    int16
	UpdatedAt pgtype.Timestamptz
}

type ReadingList

type ReadingList struct {
	UserID                pgtype.UUID
	BookID                int64
	Status                ReadingListStatus
	LastAccessedChapterID pgtype.Int8
	LastUpdatedAt         pgtype.Timestamptz
}

type ReadingListHistory

type ReadingListHistory struct {
	UserID          pgtype.UUID
	BookID          int64
	ChapterID       int64
	FinishedReading bool
	Progress        int32
}

type ReadingListStatus

type ReadingListStatus string
const (
	ReadingListStatusDnf        ReadingListStatus = "dnf"
	ReadingListStatusReading    ReadingListStatus = "reading"
	ReadingListStatusPaused     ReadingListStatus = "paused"
	ReadingListStatusRead       ReadingListStatus = "read"
	ReadingListStatusWantToRead ReadingListStatus = "want_to_read"
)

func (*ReadingListStatus) Scan

func (e *ReadingListStatus) Scan(src interface{}) error

type Review

type Review struct {
	UserID        pgtype.UUID
	BookID        int64
	Content       string
	CreatedAt     pgtype.Timestamptz
	LastUpdatedAt pgtype.Timestamptz
	Likes         int32
}

type SearchDefinedTagsParams

type SearchDefinedTagsParams struct {
	LowercasedName string
	Limit          int32
}

type SearchDefinedTagsWithTypeParams

type SearchDefinedTagsWithTypeParams struct {
	LowercasedName string
	Limit          int32
	TagType        TagType
}

type Session

type Session struct {
	ID           int64
	Sid          string
	UserID       pgtype.UUID
	CreatedAt    pgtype.Timestamptz
	UserAgent    string
	IpAddress    string
	ExpiresAt    pgtype.Timestamptz
	IsTerminated bool
}

type Session_GetInfoRow

type Session_GetInfoRow struct {
	ID           int64
	Sid          string
	UserID       pgtype.UUID
	CreatedAt    pgtype.Timestamptz
	UserAgent    string
	IpAddress    string
	ExpiresAt    pgtype.Timestamptz
	IsTerminated bool
	UserName     string
	UserJoinedAt pgtype.Timestamptz
	UserRole     UserRole
}

type Session_GetUserSessionsRow

type Session_GetUserSessionsRow struct {
	ID           int64
	Sid          string
	UserID       pgtype.UUID
	CreatedAt    pgtype.Timestamptz
	UserAgent    string
	IpAddress    string
	ExpiresAt    pgtype.Timestamptz
	IsTerminated bool
	UserID_2     pgtype.UUID
	UserName     string
	UserJoinedAt pgtype.Timestamptz
}

type Session_InsertParams

type Session_InsertParams struct {
	ID        int64
	Sid       string
	UserID    pgtype.UUID
	CreatedAt pgtype.Timestamptz
	UserAgent string
	IpAddress string
	ExpiresAt pgtype.Timestamptz
}

type SetBookReadingListChapterParams

type SetBookReadingListChapterParams struct {
	BookID                int64
	UserID                pgtype.UUID
	LastAccessedChapterID pgtype.Int8
}

type SetBookReadingListStatusAndChapterParams

type SetBookReadingListStatusAndChapterParams struct {
	BookID                int64
	UserID                pgtype.UUID
	Status                ReadingListStatus
	LastAccessedChapterID pgtype.Int8
}

type SetBookReadingListStatusParams

type SetBookReadingListStatusParams struct {
	BookID int64
	UserID pgtype.UUID
	Status ReadingListStatus
}

type SiteConfig

type SiteConfig struct {
	Value []byte
	Key   string
}

type TagRow

type TagRow struct {
	ID          int64     `db:"id"`
	Name        string    `db:"name"`
	IsAdult     bool      `db:"is_adult"`
	IsSpoiler   bool      `db:"is_spoiler"`
	TagType     TagType   `db:"tag_type"`
	Description string    `db:"description"`
	IsDefault   bool      `db:"is_default"`
	CreatedAt   time.Time `db:"created_at"`

	SynonymOf     pgtype.Int8 `db:"synonym_of"`
	SynonymOfName pgtype.Text `db:"synonym_name"`
}

func ListTags

func ListTags(
	ctx context.Context,
	db DBTX,
	req ListTagsQuery,
) ([]TagRow, error)

type TagType

type TagType string
const (
	TagTypeFreeform TagType = "freeform"
	TagTypeWarning  TagType = "warning"
	TagTypeFandom   TagType = "fandom"
	TagTypeReltype  TagType = "reltype"
	TagTypeRel      TagType = "rel"
)

func (*TagType) Scan

func (e *TagType) Scan(src interface{}) error

type TypeOf2fa

type TypeOf2fa string
const (
	TypeOf2faTotp     TypeOf2fa = "totp"
	TypeOf2faWebauthn TypeOf2fa = "webauthn"
)

func (*TypeOf2fa) Scan

func (e *TypeOf2fa) Scan(src interface{}) error

type UpdateBookParams

type UpdateBookParams struct {
	ID                 int64
	Name               string
	AgeRating          AgeRating
	TagIds             []int64
	CachedParentTagIds []int64
	Summary            string
	IsPubliclyVisible  bool
}

type UpdateTagParams

type UpdateTagParams struct {
	ID          int64
	Name        string
	Description string
	IsAdult     bool
	IsSpoiler   bool
	TagType     TagType
	SynonymOf   pgtype.Int8
}

type User

type User struct {
	ID                    pgtype.UUID
	Name                  string
	Email                 string
	EmailVerified         bool
	JoinedAt              pgtype.Timestamptz
	PasswordHash          string
	Role                  UserRole
	IsBanned              bool
	AvatarFile            pgtype.Text
	About                 string
	Gender                string
	ProfileCss            string
	EnableProfileCss      bool
	DefaultTheme          string
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
	ShowAdultContent      bool
	CensoredTags          []string
	CensoredTagsMode      CensorMode
}

type User2fa

type User2fa struct {
	ID          pgtype.UUID
	UserID      pgtype.UUID
	Type        TypeOf2fa
	Key         string
	CreatedAt   pgtype.Timestamptz
	Initialized bool
	Active      bool
}

type UserActionType

type UserActionType string
const (
	UserActionTypeSecPasswordReset UserActionType = "sec_password_reset"
	UserActionTypeSec2faUmbrella   UserActionType = "sec_2fa_umbrella"
	UserActionTypeBan              UserActionType = "ban"
	UserActionTypeUnban            UserActionType = "unban"
	UserActionTypeMute             UserActionType = "mute"
	UserActionTypeUnmute           UserActionType = "unmute"
)

func (*UserActionType) Scan

func (e *UserActionType) Scan(src interface{}) error

type UserBan

type UserBan struct {
	ID             int64
	UserID         pgtype.UUID
	CreatedAt      pgtype.Timestamptz
	BannedByUserID pgtype.UUID
	Note           string
	ExpiresAt      pgtype.Timestamptz
}

type UserFollower

type UserFollower struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
	CreatedAt  pgtype.Timestamptz
}

type UserLog

type UserLog struct {
	ID          int64
	UserID      pgtype.UUID
	ActorUserID pgtype.UUID
	ActionType  UserActionType
	Payload     []byte
}

type UserRole

type UserRole string
const (
	UserRoleUser      UserRole = "user"
	UserRoleAdmin     UserRole = "admin"
	UserRoleModerator UserRole = "moderator"
	UserRoleSystem    UserRole = "system"
)

func (*UserRole) Scan

func (e *UserRole) Scan(src interface{}) error

type UserRow

type UserRow struct {
	ID       pgtype.UUID
	Name     string
	Role     UserRole
	IsBanned bool
	JoinedAt time.Time
}

func ListUsers

func ListUsers(ctx context.Context, db DBTX, req UsersQuery) ([]UserRow, error)

type User_GetAboutSettingsRow

type User_GetAboutSettingsRow struct {
	About  string
	Gender string
}

type User_GetCustomizationSettingsRow

type User_GetCustomizationSettingsRow struct {
	ProfileCss       string
	EnableProfileCss bool
	DefaultTheme     string
}

type User_GetDetailsParams

type User_GetDetailsParams struct {
	ID          pgtype.UUID
	ActorUserID pgtype.UUID
}

type User_GetDetailsRow

type User_GetDetailsRow struct {
	ID                    pgtype.UUID
	Name                  string
	Email                 string
	EmailVerified         bool
	JoinedAt              pgtype.Timestamptz
	PasswordHash          string
	Role                  UserRole
	IsBanned              bool
	AvatarFile            pgtype.Text
	About                 string
	Gender                string
	ProfileCss            string
	EnableProfileCss      bool
	DefaultTheme          string
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
	ShowAdultContent      bool
	CensoredTags          []string
	CensoredTagsMode      CensorMode
	BooksTotal            int64
	Followers             int64
	Following             int64
	IsFollowing           bool
}

type User_GetModerationSettingsRow

type User_GetModerationSettingsRow struct {
	ShowAdultContent bool
	CensoredTags     []string
	CensoredTagsMode CensorMode
}

type User_GetNamesRow

type User_GetNamesRow struct {
	Name string
	ID   pgtype.UUID
}

type User_InsertFollowParams

type User_InsertFollowParams struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
}

type User_InsertParams

type User_InsertParams struct {
	ID            pgtype.UUID
	Name          string
	PasswordHash  string
	JoinedAt      pgtype.Timestamptz
	Email         string
	EmailVerified bool
}

type User_IsFollowingParams

type User_IsFollowingParams struct {
	FollowerID pgtype.UUID
	FollowedID pgtype.UUID
}

type User_SetEmailVerifiedParams

type User_SetEmailVerifiedParams struct {
	EmailVerified bool
	ID            pgtype.UUID
}

type User_UpdateAboutSettingsParams

type User_UpdateAboutSettingsParams struct {
	ID     pgtype.UUID
	About  string
	Gender string
}

type User_UpdateCustomizationSettingsParams

type User_UpdateCustomizationSettingsParams struct {
	ID               pgtype.UUID
	ProfileCss       string
	EnableProfileCss bool
	DefaultTheme     string
}

type User_UpdateModerationSettingsParams

type User_UpdateModerationSettingsParams struct {
	ID               pgtype.UUID
	ShowAdultContent bool
	CensoredTags     []string
	CensoredTagsMode CensorMode
}

type User_UpdatePasswordParams

type User_UpdatePasswordParams struct {
	ID           pgtype.UUID
	PasswordHash string
}

type User_UpdatePrivacySettingsParams

type User_UpdatePrivacySettingsParams struct {
	ID                    pgtype.UUID
	PrivacyHideStats      bool
	PrivacyHideComments   bool
	PrivacyHideEmail      bool
	PrivacyAllowSearching bool
}

type User_UpdateRoleParams

type User_UpdateRoleParams struct {
	ID   pgtype.UUID
	Role UserRole
}

type UsersQuery

type UsersQuery struct {
	Query  string
	Roles  []UserRole
	Banned bool

	Limit  uint
	Offset uint
}

Jump to

Keyboard shortcuts

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