forum

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArticleDetail

func ArticleDetail(c *gin.Context)

func ArticleRepliesWindow added in v0.2.2

func Category

func Category(c *gin.Context)

func Home

func Home(c *gin.Context)
func Links(c *gin.Context)

func Login

func Login(c *gin.Context)

func Messages

func Messages(c *gin.Context)

func Notifications

func Notifications(c *gin.Context)

func Publish

func Publish(c *gin.Context)

func ReloadTemplates

func ReloadTemplates()

func ResetPassword

func ResetPassword(c *gin.Context)
func Search(c *gin.Context)

func Settings

func Settings(c *gin.Context)

func Sponsors

func Sponsors(c *gin.Context)

func UserProfile

func UserProfile(c *gin.Context)

Types

type AnnouncementPayload

type AnnouncementPayload struct {
	Enabled bool   `json:"enabled"`
	HTML    string `json:"html"`
}

type ArticleDetailProps

type ArticleDetailProps struct {
	Article     ArticlePayload     `json:"article"`
	Replies     []ReplyPayload     `json:"replies"`
	HotTopics   []TopicPayload     `json:"hotTopics"`
	Permissions ArticlePermissions `json:"permissions"`
}

type ArticlePayload

type ArticlePayload struct {
	ID           uint64                 `json:"id"`
	Title        string                 `json:"title"`
	Description  string                 `json:"description"`
	URL          string                 `json:"url"`
	HTML         string                 `json:"html"`
	Author       TopicAuthorPayload     `json:"author"`
	Participants []TopicAuthorPayload   `json:"participants"`
	Categories   []TopicCategoryPayload `json:"categories"`
	ReplyCount   uint64                 `json:"replyCount"`
	ViewCount    uint64                 `json:"viewCount"`
	LikeCount    uint64                 `json:"likeCount"`
	IsLiked      bool                   `json:"isLiked"`
	IsBookmarked bool                   `json:"isBookmarked"`
	CreatedAt    string                 `json:"createdAt"`
	UpdatedAt    string                 `json:"updatedAt"`
}

type ArticlePermissions

type ArticlePermissions struct {
	IsOwnArticle bool `json:"isOwnArticle"`
	CanReply     bool `json:"canReply"`
}

type ArticleRepliesWindowReq added in v0.2.2

type ArticleRepliesWindowReq struct {
	ArticleID     uint64 `form:"articleId"`
	AnchorReplyID uint64 `form:"anchorReplyId"`
	Before        uint64 `form:"before"`
	After         uint64 `form:"after"`
	Limit         int    `form:"limit"`
}

type CategoryHeaderPayload

type CategoryHeaderPayload struct {
	ID          uint64 `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Icon        string `json:"icon"`
	Color       string `json:"color"`
	URL         string `json:"url"`
}

type CategoryNavPayload

type CategoryNavPayload struct {
	NavItemPayload
	ID    uint64 `json:"id"`
	Color string `json:"color"`
}

type CategoryPageProps

type CategoryPageProps struct {
	Category   CategoryHeaderPayload `json:"category"`
	Sort       string                `json:"sort"`
	Tabs       []TabPayload          `json:"tabs"`
	Topics     []TopicPayload        `json:"topics"`
	Pagination PaginationPayload     `json:"pagination"`
}

type ErrorPageProps

type ErrorPageProps struct {
	Code    string `json:"code"`
	Title   string `json:"title"`
	Message string `json:"message"`
}

type FooterPayload

type FooterPayload struct {
	Links   []pageConfig.FooterItem `json:"links"`
	Primary []string                `json:"primary"`
}

type FriendLinkPayload

type FriendLinkPayload struct {
	Name    string `json:"name"`
	Desc    string `json:"desc"`
	URL     string `json:"url"`
	LogoURL string `json:"logoUrl"`
}

type HomeProps

type HomeProps struct {
	Sort         string              `json:"sort"`
	Tabs         []TabPayload        `json:"tabs"`
	Topics       []TopicPayload      `json:"topics"`
	Pagination   PaginationPayload   `json:"pagination"`
	Announcement AnnouncementPayload `json:"announcement"`
}

type LayoutPayload

type LayoutPayload struct {
	Site    SitePayload         `json:"site"`
	Viewer  ViewerPayload       `json:"viewer"`
	Sidebar SidebarPayload      `json:"sidebar"`
	Footer  FooterPayload       `json:"footer"`
	Unread  UnreadStatusPayload `json:"unread"`
}

type LinkGroupPayload

type LinkGroupPayload struct {
	Name  string              `json:"name"`
	Emoji string              `json:"emoji"`
	Color string              `json:"color"`
	Links []FriendLinkPayload `json:"links"`
}

type LinksPageProps

type LinksPageProps struct {
	Groups     []LinkGroupPayload `json:"groups"`
	TotalCount int                `json:"totalCount"`
}

type LoginPageProps

type LoginPageProps struct {
	InitialMode string `json:"initialMode"`
	RedirectURL string `json:"redirectUrl"`
	GitHubURL   string `json:"githubUrl"`
	GoogleReady bool   `json:"googleReady"`
}

type MessageConversationPayload

type MessageConversationPayload struct {
	ID           uint64 `json:"id"`
	PeerID       uint64 `json:"peerId"`
	PeerUsername string `json:"peerUsername"`
	PeerAvatar   string `json:"peerAvatar"`
	LastMsg      string `json:"lastMsg"`
	LastMsgTime  string `json:"lastMsgTime"`
	UnreadCount  uint   `json:"unreadCount"`
	ConvID       uint64 `json:"convId"`
	PeerURL      string `json:"peerUrl"`
}

type MessagesPageProps

type MessagesPageProps struct {
	Conversations  []MessageConversationPayload `json:"conversations"`
	SuggestedUsers []UserConnectionPayload      `json:"suggestedUsers"`
}
type NavItemPayload struct {
	Key    string `json:"key"`
	Label  string `json:"label"`
	Icon   string `json:"icon"`
	URL    string `json:"url"`
	Active bool   `json:"active"`
}

type NotificationArticlePayload

type NotificationArticlePayload struct {
	ID    uint64 `json:"id"`
	Title string `json:"title"`
	URL   string `json:"url"`
}

type NotificationPayload

type NotificationPayload struct {
	ID        uint64                                `json:"id"`
	EventType string                                `json:"eventType"`
	IsRead    bool                                  `json:"isRead"`
	CreatedAt string                                `json:"createdAt"`
	Title     string                                `json:"title"`
	Content   string                                `json:"content"`
	Actor     TopicAuthorPayload                    `json:"actor"`
	Article   *NotificationArticlePayload           `json:"article,omitempty"`
	Payload   eventNotification.NotificationPayload `json:"payload"`
}

type NotificationsPageProps

type NotificationsPageProps struct {
	Total         int64                 `json:"total"`
	UnreadCount   int64                 `json:"unreadCount"`
	Notifications []NotificationPayload `json:"notifications"`
	Pagination    PaginationPayload     `json:"pagination"`
}

type OpenGraphMeta added in v0.2.2

type OpenGraphMeta struct {
	Title         string   `json:"title,omitempty"`
	Description   string   `json:"description,omitempty"`
	Type          string   `json:"type,omitempty"`
	URL           string   `json:"url,omitempty"`
	SiteName      string   `json:"siteName,omitempty"`
	Image         string   `json:"image,omitempty"`
	PublishedTime string   `json:"publishedTime,omitempty"`
	ModifiedTime  string   `json:"modifiedTime,omitempty"`
	Author        string   `json:"author,omitempty"`
	Section       string   `json:"section,omitempty"`
	Tags          []string `json:"tags,omitempty"`
}

type PageMeta

type PageMeta struct {
	Title       string         `json:"title"`
	Description string         `json:"description,omitempty"`
	Canonical   string         `json:"canonical,omitempty"`
	Robots      string         `json:"robots,omitempty"`
	OpenGraph   *OpenGraphMeta `json:"openGraph,omitempty"`
	Twitter     *TwitterMeta   `json:"twitter,omitempty"`
	JSONLD      any            `json:"jsonLd,omitempty"`
}

type PagePayload

type PagePayload struct {
	Component string        `json:"component"`
	Props     any           `json:"props"`
	Meta      PageMeta      `json:"meta"`
	Layout    LayoutPayload `json:"layout"`
	URL       string        `json:"url"`
	Version   string        `json:"version"`
}

type PaginationPayload

type PaginationPayload struct {
	Page     int    `json:"page"`
	NextPage int    `json:"nextPage"`
	HasNext  bool   `json:"hasNext"`
	NextURL  string `json:"nextUrl"`
}

type PublishArticlePayload

type PublishArticlePayload struct {
	Title       string   `json:"title"`
	Content     string   `json:"content"`
	Type        int8     `json:"type"`
	CategoryIDs []uint64 `json:"categoryIds"`
}

type PublishCategoryPayload

type PublishCategoryPayload struct {
	ID    uint64 `json:"id"`
	Name  string `json:"name"`
	Color string `json:"color"`
}

type PublishPageProps

type PublishPageProps struct {
	ArticleID  uint64                   `json:"articleId"`
	IsEditing  bool                     `json:"isEditing"`
	Categories []PublishCategoryPayload `json:"categories"`
	Types      []PublishTypePayload     `json:"types"`
	Article    PublishArticlePayload    `json:"article"`
}

type PublishTypePayload

type PublishTypePayload struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

type ReplyPayload

type ReplyPayload struct {
	ID              uint64             `json:"id"`
	ArticleID       uint64             `json:"articleId"`
	Content         string             `json:"content"`
	RenderedContent string             `json:"renderedContent"`
	Author          TopicAuthorPayload `json:"author"`
	CreatedAt       string             `json:"createdAt"`
	ReplyToID       uint64             `json:"replyToId,omitempty"`
	ReplyToUserID   uint64             `json:"replyToUserId,omitempty"`
	ReplyToUsername string             `json:"replyToUsername,omitempty"`
	IsOwnReply      bool               `json:"isOwnReply"`
}

type ReplyWindowPayload added in v0.2.2

type ReplyWindowPayload struct {
	Replies       []ReplyPayload `json:"replies"`
	AnchorReplyID uint64         `json:"anchorReplyId,omitempty"`
	BeforeCursor  uint64         `json:"beforeCursor,omitempty"`
	AfterCursor   uint64         `json:"afterCursor,omitempty"`
	HasBefore     bool           `json:"hasBefore"`
	HasAfter      bool           `json:"hasAfter"`
	Total         int64          `json:"total"`
}

type ResetPasswordPageProps

type ResetPasswordPageProps struct {
	Token string `json:"token"`
}

type SearchPageProps

type SearchPageProps struct {
	Query      string            `json:"query"`
	Topics     []TopicPayload    `json:"topics"`
	Total      int64             `json:"total"`
	TotalPages int               `json:"totalPages"`
	Pagination PaginationPayload `json:"pagination"`
}

type SettingsPageProps

type SettingsPageProps struct {
	User  *vo.UserDetailedVo   `json:"user"`
	Stats SettingsStatsPayload `json:"stats"`
	Tabs  []TabPayload         `json:"tabs"`
}

type SettingsStatsPayload

type SettingsStatsPayload struct {
	ArticleCount      uint   `json:"articleCount"`
	ReplyCount        uint   `json:"replyCount"`
	FollowerCount     uint   `json:"followerCount"`
	FollowingCount    uint   `json:"followingCount"`
	LikeReceivedCount uint   `json:"likeReceivedCount"`
	CreatedAt         string `json:"createdAt"`
}

type SidebarPayload

type SidebarPayload struct {
	Main       []NavItemPayload     `json:"main"`
	Resources  []NavItemPayload     `json:"resources"`
	Categories []CategoryNavPayload `json:"categories"`
	ActiveKey  string               `json:"activeKey"`
}

type SitePayload

type SitePayload struct {
	Name          string `json:"name"`
	Description   string `json:"description"`
	Favicon       string `json:"favicon"`
	ExternalLinks string `json:"externalLinks,omitempty"`
	BrandType     string `json:"brandType"`
	BrandText     string `json:"brandText"`
	BrandImage    string `json:"brandImage"`
}

type SponsorPayload

type SponsorPayload struct {
	Name      string `json:"name"`
	Message   string `json:"message"`
	Link      string `json:"link"`
	AvatarURL string `json:"avatarUrl"`
}

type SponsorSectionPayload

type SponsorSectionPayload struct {
	Key      string           `json:"key"`
	Label    string           `json:"label"`
	Tone     string           `json:"tone"`
	Sponsors []SponsorPayload `json:"sponsors"`
}

type SponsorsContactPayload added in v0.2.2

type SponsorsContactPayload struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	ButtonText  string `json:"buttonText"`
	ButtonLink  string `json:"buttonLink"`
}

type SponsorsPageIntroPayload added in v0.2.2

type SponsorsPageIntroPayload struct {
	Title       string `json:"title"`
	Description string `json:"description"`
}

type SponsorsPageProps

type SponsorsPageProps struct {
	Sections   []SponsorSectionPayload  `json:"sections"`
	TotalCount int                      `json:"totalCount"`
	Content    SponsorsPageIntroPayload `json:"content"`
	Contact    SponsorsContactPayload   `json:"contact"`
	Rules      []SponsorsRulePayload    `json:"rules"`
}

type SponsorsRulePayload added in v0.2.2

type SponsorsRulePayload struct {
	Content string `json:"content"`
}

type TabPayload

type TabPayload struct {
	Key    string `json:"key"`
	Label  string `json:"label"`
	URL    string `json:"url"`
	Active bool   `json:"active"`
}

type TopicAuthorPayload

type TopicAuthorPayload struct {
	ID        uint64 `json:"id"`
	Username  string `json:"username"`
	AvatarURL string `json:"avatarUrl"`
}

type TopicCategoryPayload

type TopicCategoryPayload struct {
	ID    uint64 `json:"id"`
	Name  string `json:"name"`
	URL   string `json:"url"`
	Color string `json:"color"`
}

type TopicPayload

type TopicPayload struct {
	ID             uint64                 `json:"id"`
	Title          string                 `json:"title"`
	Description    string                 `json:"description"`
	URL            string                 `json:"url"`
	Author         TopicAuthorPayload     `json:"author"`
	Participants   []TopicAuthorPayload   `json:"participants"`
	Categories     []TopicCategoryPayload `json:"categories"`
	ReplyCount     uint64                 `json:"replyCount"`
	ViewCount      uint64                 `json:"viewCount"`
	ActivityText   string                 `json:"activityText"`
	LastUpdateTime string                 `json:"lastUpdateTime"`
}

type TwitterMeta added in v0.2.2

type TwitterMeta struct {
	Card        string `json:"card,omitempty"`
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Image       string `json:"image,omitempty"`
}

type UnreadStatusPayload added in v0.2.2

type UnreadStatusPayload struct {
	Notifications          bool   `json:"notifications"`
	Messages               bool   `json:"messages"`
	LatestNotificationType string `json:"latestNotificationType,omitempty"`
}

type UserActivityPayload

type UserActivityPayload struct {
	ID             uint64 `json:"id"`
	Action         int    `json:"action"`
	SubjectType    string `json:"subjectType"`
	SubjectID      uint64 `json:"subjectId"`
	ContentPreview string `json:"contentPreview"`
	URL            string `json:"url"`
	Label          string `json:"label"`
	CreatedAt      string `json:"createdAt"`
}

type UserConnectionPayload

type UserConnectionPayload struct {
	ID        uint64 `json:"id"`
	Username  string `json:"username"`
	Nickname  string `json:"nickname"`
	AvatarURL string `json:"avatarUrl"`
	Bio       string `json:"bio"`
	URL       string `json:"url"`
}

type UserProfileProps

type UserProfileProps struct {
	User         *vo.UserCard             `json:"user"`
	Badges       []badgeservice.UserBadge `json:"badges"`
	Topics       []TopicPayload           `json:"topics"`
	Activities   []UserActivityPayload    `json:"activities"`
	Following    []UserConnectionPayload  `json:"following"`
	Followers    []UserConnectionPayload  `json:"followers"`
	IsOwnProfile bool                     `json:"isOwnProfile"`
	CanMessage   bool                     `json:"canMessage"`
	CanFollow    bool                     `json:"canFollow"`
	MessageURL   string                   `json:"messageUrl"`
	SettingsURL  string                   `json:"settingsUrl"`
}

type ViewerPayload

type ViewerPayload struct {
	ID              uint64 `json:"id"`
	Username        string `json:"username"`
	AvatarURL       string `json:"avatarUrl"`
	IsAuthenticated bool   `json:"isAuthenticated"`
	IsAdmin         bool   `json:"isAdmin"`
}

Jump to

Keyboard shortcuts

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