models

package
v0.0.0-...-c0aa622 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BanHistory

type BanHistory struct {
	StartTime   null.Time   `db:"start_time" json:"startTime"`
	EndTime     null.Time   `db:"end_time" json:"endTime"`
	Reason      null.String `db:"reason" json:"reason"`
	UserID      null.Int    `db:"user_id" json:"userId"`
	ModeratorID null.Int    `db:"created_at" json:"createdAt"`
}

type Bookmark

type Bookmark struct {
	PostID    null.Int  `db:"post_id" json:"postId"`
	UserID    null.Int  `db:"user_id" json:"userId"`
	CreatedAt null.Time `db:"created_at" json:"createdAt"`
}

type Comment

type Comment struct {
	ID                null.Int    `db:"id" json:"id"`
	Content           null.String `db:"content" json:"content"`
	AuthorID          null.Int    `db:"author_id" json:"authorId"`
	PostID            null.Int    `db:"post_id" json:"postId"`
	ParentCommentID   null.Int    `db:"parent_comment_id" json:"parentCommentId"`
	CreatedAt         null.Time   `db:"created_at" json:"createdAt"`
	UpdatedAt         null.Time   `db:"updated_at" json:"updatedAt"`
	DeletedAt         null.Time   `db:"deleted_at" json:"deletedAt"`
	ReasonForDeletion null.String `db:"reason_for_deletion" json:"reasonForDeletion"`
	ModeratorID       null.Int    `db:"moderator_id" json:"moderatorId"`
}

type Post

type Post struct {
	ID                null.Int    `db:"id" json:"id"`
	Title             null.String `db:"title" json:"title"`
	Content           null.String `db:"content" json:"content"`
	AuthorID          null.Int    `db:"author_id" json:"authorId"`
	TopicID           null.Int    `db:"topic_id" json:"topicId"`
	CreatedAt         null.Time   `db:"created_at" json:"createdAt"`
	UpdatedAt         null.Time   `db:"updated_at" json:"updatedAt"`
	DeletedAt         null.Time   `db:"deleted_at" json:"deletedAt"`
	ReasonForDeletion null.String `db:"reason_for_deletion" json:"reasonForDeletion"`
	ModeratorID       null.Int    `db:"moderator_id" json:"moderatorId"`
}

type Relation

type Relation struct {
	FollowerID  null.Int  `db:"follower_id" json:"followerId"`
	FollowingID null.Int  `db:"following_id" json:"followingId"`
	CreatedAt   null.Time `db:"created_at" json:"createdAt"`
}

type SearchCommentsOptions

type SearchCommentsOptions struct {
	PostID          int64
	ParentCommentID null.Int
	Query           string `form:"q"`

	// similarity: sort by the similarity of word composition, using pg_trgm extension.
	// age-asc (default): sort from the newest post.
	// age-desc: sort from the oldest post.
	SortBy string `form:"sort-by"`
}

type SearchPostsOptions

type SearchPostsOptions struct {
	Query string `form:"q"`

	// similarity: sort by the similarity of word composition, using pg_trgm extension.
	// popularity: sort roughly by view, comment, or vote counts.
	// age-asc (default): sort from the newest post.
	// age-desc: sort from the oldest post.
	SortBy string `form:"sort-by"`

	// title: compare query with only title.
	// all (default): compare query with both title and content.
	MatchWith string `form:"match-with"`

	Topics []string `form:"topics"`
	Tags   []string `form:"tags"`
}

type SearchTagsOptions

type SearchTagsOptions struct {
	Query string `form:"q"`

	// similarity (default): sort by the similarity of word composition, using pg_trgm extension.
	// popularity: sort  by number of posts using it.
	SortBy string `form:"sort-by"`

	// left: only shows results which matches the left part of the string and passes the no-match criteria.
	// substring: only shows results which matches some substring and passes the no-match criteria.
	// none (default): shows results which passes a certain threshold of similarness determined by pg_trgm.
	MustMatch string `form:"must-match"`
}

type SearchTopicsOptions

type SearchTopicsOptions struct {
	Query string `form:"q"`

	// similarity (default): sort by the similarity of word composition, using pg_trgm extension.
	// popularity: sort roughly by subscription and post counts.
	SortBy string `form:"sort-by"`

	// left: only shows results which matches the left part of the string and passes the no-match criteria.
	// substring: only shows results which matches some substring and passes the no-match criteria.
	// none (default): shows results which passes a certain threshold of similarness determined by pg_trgm.
	MustMatch string `form:"must-match"`
}

type SearchUsersOptions

type SearchUsersOptions struct {
	Query string `form:"q"`

	// similarity (default): sort by the similarity of word composition, using pg_trgm extension.
	// popularity: sort roughly by user followings and total vote counts.
	SortBy string `form:"sort-by"`

	// left: only shows results which matches the left part of the string and passes the no-match criteria.
	// substring: only shows results which matches some substring and passes the no-match criteria.
	// none (default): shows results which passes a certain threshold of similarness determined by pg_trgm.
	MustMatch string `form:"must-match"`
}

type Subscription

type Subscription struct {
	TopicID   null.Int  `db:"topic_id" json:"topicId"`
	UserID    null.Int  `db:"user_id" json:"userId"`
	CreatedAt null.Time `db:"created_at" json:"createdAt"`
}

type Tag

type Tag struct {
	ID        null.Int    `db:"id" json:"id"`
	Tag       null.String `db:"tag" json:"tag"`
	Hub       null.String `db:"hub" json:"hub"`
	CreatedAt null.Time   `db:"created_at" json:"createdAt"`
}

type TaggedPost

type TaggedPost struct {
	PostID null.Int `db:"post_id" json:"postId"`
	TagID  null.Int `db:"tag_id" json:"tagId"`
}

type Topic

type Topic struct {
	ID          null.Int    `db:"id" json:"id"`
	Topic       null.String `db:"topic" json:"topic"`
	Hub         null.String `db:"hub" json:"hub"`
	Description null.String `db:"description" json:"description"`
	CreatedAt   null.Time   `db:"created_at" json:"createdAt"`
}

type User

type User struct {
	ID           null.Int    `db:"id" json:"id"`
	Email        null.String `db:"email" json:"email"`
	PasswordHash null.String `db:"password_hash" json:"passwordHash"`
	ModRole      null.Bool   `db:"mod_role" json:"modRole"`
	Username     null.String `db:"username" json:"username"`
	Nickname     null.String `db:"nickname" json:"nickname"`
	About        null.String `db:"about" json:"about"`
	CreatedAt    null.Time   `db:"created_at" json:"createdAt"`
}

type Vote

type Vote struct {
	Up        null.Bool `db:"up" json:"up"`
	PostID    null.Int  `db:"post_id" json:"postId"`
	UserID    null.Int  `db:"user_id" json:"userId"`
	CreatedAt null.Time `db:"created_at" json:"createdAt"`
}

Jump to

Keyboard shortcuts

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