Versions in this module Expand all Collapse all v0 v0.1.0 Nov 5, 2026 Changes in this version + const ActionGroup + const ActionTopicMove + const ActionTopicPin + const ActionTopicUnpin + var Assets embed.FS + func CommentsChanged(repo *EntForumRepository) func(ctx context.Context, nodeID int) error + func ForumUninstallStep(settings ForumSettingsRepository, vocabularies interface{ ... }, ...) func(ctx context.Context) error + func RegisterAdminRoutes(r modulekit.Mux, fc *ForumController, admin func(http.Handler) http.Handler) + func RegisterForumRoutes(r modulekit.Mux, store *sessions.CookieStore, fc *ForumController) + func SitemapPaths(svc ForumService) func(ctx context.Context) ([]string, error) + func Wire(d modulekit.Deps) modulekit.Parts + type DefaultForumService struct + func (s *DefaultForumService) CountTopics(ctx context.Context, sectionID int) (int, error) + func (s *DefaultForumService) CreateTopic(ctx context.Context, sectionID int, title, body string, authorID int) (*ForumTopicDetail, error) + func (s *DefaultForumService) GetCategory(ctx context.Context, id int) (*ForumCategory, error) + func (s *DefaultForumService) GetForumIndex(ctx context.Context) (*ForumIndex, error) + func (s *DefaultForumService) GetForumTermsForSelect(ctx context.Context) ([]ForumTermOption, error) + func (s *DefaultForumService) GetSectionBySlug(ctx context.Context, slug string) (*ForumSectionPage, int, error) + func (s *DefaultForumService) GetStatistics(ctx context.Context) (*ForumStatistics, error) + func (s *DefaultForumService) GetTopic(ctx context.Context, slug string) (*ForumTopicDetail, error) + func (s *DefaultForumService) GetTopicSectionID(ctx context.Context, nodeID int) (int, error) + func (s *DefaultForumService) GetTopics(ctx context.Context, sectionID int, filter ForumTopicFilter) ([]ForumTopic, error) + func (s *DefaultForumService) ListTopics(ctx context.Context, filter ForumTopicFilter) ([]ForumTopic, int, error) + func (s *DefaultForumService) SectionPathPrefix(ctx context.Context) string + func (s *DefaultForumService) SetTopicSticky(ctx context.Context, topic modulekit.Node, sticky bool) error + func (s *DefaultForumService) UpdateTopic(ctx context.Context, nodeID int, title, body string, sectionID int) error + type EntForumRepository struct + func NewForumRepository(db *sql.DB, nodes modulekit.NodesRepository, users modulekit.UserRepository, ...) *EntForumRepository + func (r *EntForumRepository) CountTopicsBySection(ctx context.Context, sectionID int) (int, error) + func (r *EntForumRepository) CountTopicsFiltered(ctx context.Context, filter ForumTopicFilter) (int, error) + func (r *EntForumRepository) CreateTopic(ctx context.Context, sectionID int, title, body string, authorID int) (*ForumTopicDetail, error) + func (r *EntForumRepository) GetForumCategories(ctx context.Context) ([]ForumCategory, error) + func (r *EntForumRepository) GetForumStatistics(ctx context.Context) (*ForumStatistics, error) + func (r *EntForumRepository) GetForumTermsForSelect(ctx context.Context) ([]ForumTermOption, error) + func (r *EntForumRepository) GetSectionBySlug(ctx context.Context, slug string) (*ForumSection, error) + func (r *EntForumRepository) GetTopicBySlug(ctx context.Context, slug string) (*ForumTopicDetail, error) + func (r *EntForumRepository) GetTopicSectionID(ctx context.Context, nodeID int) (int, error) + func (r *EntForumRepository) GetTopicsBySection(ctx context.Context, sectionID int, filter ForumTopicFilter) ([]ForumTopic, error) + func (r *EntForumRepository) ListTopics(ctx context.Context, filter ForumTopicFilter) ([]ForumTopic, error) + func (r *EntForumRepository) RecountTopicStats(ctx context.Context, nodeID int) error + func (r *EntForumRepository) SectionPathPrefix(ctx context.Context) (string, error) + func (r *EntForumRepository) SetSticky(ctx context.Context, nodeID int, sticky bool) error + func (r *EntForumRepository) TopicExistsBySlug(ctx context.Context, slug string) (bool, error) + func (r *EntForumRepository) UpdateTopic(ctx context.Context, nodeID int, title, body string, sectionID int) error + type EntForumSettingsRepository struct + func NewForumSettingsRepository(db *sql.DB) *EntForumSettingsRepository + func (r *EntForumSettingsRepository) Get(ctx context.Context) (*ForumSettings, error) + func (r *EntForumSettingsRepository) Update(ctx context.Context, s *ForumSettings) error + type ForumCategory struct + Description string + ID int + Name string + Sections []ForumSection + Slug string + Weight int + func ToForumCategoriesEntity(rows []ForumCategoryRowDTO) []ForumCategory + type ForumCategoryRowDTO struct + ContainerDesc string + ContainerID int + ContainerName string + ContainerSlug string + ContainerWeight int + LastActivity sql.NullTime + LastAuthor sql.NullString + LastTopicSlug sql.NullString + LastTopicTitle sql.NullString + PostsCount int + SectionDesc sql.NullString + SectionID sql.NullInt64 + SectionName sql.NullString + SectionSlug sql.NullString + SectionWeight sql.NullInt64 + TopicsCount int + type ForumCommentRowDTO struct + AuthorCreated time.Time + AuthorID int + AuthorName string + Content string + CreatedAt time.Time + ID int + ParentID sql.NullInt64 + type ForumController struct + func NewForumController(deps modulekit.BaseDeps, d ForumDeps) *ForumController + func (c *ForumController) ActiveTopics(w http.ResponseWriter, r *http.Request) + func (c *ForumController) CreateTopicForm(w http.ResponseWriter, r *http.Request) + func (c *ForumController) CreateTopicSubmit(w http.ResponseWriter, r *http.Request) + func (c *ForumController) DeleteTopic(w http.ResponseWriter, r *http.Request) + func (c *ForumController) DeleteTopicConfirm(w http.ResponseWriter, r *http.Request) + func (c *ForumController) EditTopicForm(w http.ResponseWriter, r *http.Request) + func (c *ForumController) EditTopicSubmit(w http.ResponseWriter, r *http.Request) + func (c *ForumController) ForumSettingsPage(w http.ResponseWriter, r *http.Request) + func (c *ForumController) Index(w http.ResponseWriter, r *http.Request) + func (c *ForumController) Section(w http.ResponseWriter, r *http.Request) + func (c *ForumController) SectionFallback(w http.ResponseWriter, r *http.Request) bool + func (c *ForumController) StickTopic(w http.ResponseWriter, r *http.Request) + func (c *ForumController) UnansweredTopics(w http.ResponseWriter, r *http.Request) + type ForumDeps struct + ForumService ForumService + NodeDeleter modulekit.NodeDeleter + Settings ForumSettingsRepository + TaxonomyService modulekit.TaxonomyService + type ForumIndex struct + Categories []ForumCategory + Statistics *ForumStatistics + type ForumLastComment struct + Author string + ID int + Timestamp time.Time + type ForumLastTopic struct + Author string + ID int + Slug string + Timestamp time.Time + Title string + func (t ForumLastTopic) Path() string + type ForumRepository interface + CountTopicsBySection func(ctx context.Context, sectionID int) (int, error) + CountTopicsFiltered func(ctx context.Context, filter ForumTopicFilter) (int, error) + CreateTopic func(ctx context.Context, sectionID int, title, body string, authorID int) (*ForumTopicDetail, error) + GetForumCategories func(ctx context.Context) ([]ForumCategory, error) + GetForumStatistics func(ctx context.Context) (*ForumStatistics, error) + GetForumTermsForSelect func(ctx context.Context) ([]ForumTermOption, error) + GetSectionBySlug func(ctx context.Context, slug string) (*ForumSection, error) + GetTopicBySlug func(ctx context.Context, slug string) (*ForumTopicDetail, error) + GetTopicSectionID func(ctx context.Context, nodeID int) (int, error) + GetTopicsBySection func(ctx context.Context, sectionID int, filter ForumTopicFilter) ([]ForumTopic, error) + ListTopics func(ctx context.Context, filter ForumTopicFilter) ([]ForumTopic, error) + SectionPathPrefix func(ctx context.Context) (string, error) + SetSticky func(ctx context.Context, nodeID int, sticky bool) error + TopicExistsBySlug func(ctx context.Context, slug string) (bool, error) + UpdateTopic func(ctx context.Context, nodeID int, title, body string, sectionID int) error + type ForumSection struct + Description string + ID int + LastTopic *ForumLastTopic + Name string + ParentID int + ParentName string + ParentSlug string + PostsCount int + Slug string + TopicsCount int + Weight int + func ToForumSectionEntity(row ForumCategoryRowDTO) ForumSection + type ForumSectionPage struct + Section *ForumSection + Topics []ForumTopic + TotalCount int + type ForumService interface + CountTopics func(ctx context.Context, sectionID int) (int, error) + CreateTopic func(ctx context.Context, sectionID int, title, body string, authorID int) (*ForumTopicDetail, error) + GetCategory func(ctx context.Context, id int) (*ForumCategory, error) + GetForumIndex func(ctx context.Context) (*ForumIndex, error) + GetForumTermsForSelect func(ctx context.Context) ([]ForumTermOption, error) + GetSectionBySlug func(ctx context.Context, slug string) (*ForumSectionPage, int, error) + GetStatistics func(ctx context.Context) (*ForumStatistics, error) + GetTopic func(ctx context.Context, slug string) (*ForumTopicDetail, error) + GetTopicSectionID func(ctx context.Context, nodeID int) (int, error) + GetTopics func(ctx context.Context, sectionID int, filter ForumTopicFilter) ([]ForumTopic, error) + ListTopics func(ctx context.Context, filter ForumTopicFilter) ([]ForumTopic, int, error) + SectionPathPrefix func(ctx context.Context) string + SetTopicSticky func(ctx context.Context, topic modulekit.Node, sticky bool) error + UpdateTopic func(ctx context.Context, nodeID int, title, body string, sectionID int) error + func NewForumService(r ForumRepository, baseLogger *slog.Logger) ForumService + type ForumSettings struct + VocabularyID int + type ForumSettingsRepository interface + Get func(ctx context.Context) (*ForumSettings, error) + Update func(ctx context.Context, s *ForumSettings) error + type ForumStatistics struct + ActiveUsersCount int + LatestUsers []string + TotalPosts int + TotalTopics int + TotalUsers int + func ToForumStatisticsEntity(dto ForumStatisticsDTO, latestUsers []string) ForumStatistics + type ForumStatisticsDTO struct + TotalPosts sql.NullInt64 + TotalTopics int + TotalUsers int + type ForumTermOption struct + DisplayName string + ID int + Name string + ParentID int + type ForumTopic struct + Author *modulekit.User + CommentCount int + CreatedAt time.Time + ID int + IsHot bool + LastComment *ForumLastComment + Section *ForumTopicSection + Slug string + Sticky bool + Title string + ViewsCount int + func ToForumTopicEntity(row ForumTopicRowDTO) ForumTopic + func ToForumTopicsEntity(rows []ForumTopicRowDTO) []ForumTopic + func (t ForumTopic) Path() string + type ForumTopicDetail struct + Author *modulekit.User + CommentCount int + Comments []modulekit.Comment + Content string + CreatedAt time.Time + ID int + LastCommentAt time.Time + Section *ForumSection + Slug string + Sticky bool + Title string + UpdatedAt time.Time + ViewsCount int + func ToForumTopicDetail(n modulekit.Node, author *modulekit.User, stats *generated.ForumStats, ...) ForumTopicDetail + func (t ForumTopicDetail) Path() string + type ForumTopicDetailDTO struct + AuthorCreated time.Time + AuthorID int + AuthorName string + CommentCount int + Content string + CreatedAt time.Time + ID int + LastCommentAt time.Time + Slug string + Sticky bool + Title string + UpdatedAt time.Time + ViewsCount int + type ForumTopicFilter struct + Limit int + Offset int + OrderBy string + OrderDir string + SectionID int + Sticky *bool + Unanswered bool + type ForumTopicRowDTO struct + AuthorID int + AuthorName string + CommentCount int + CreatedAt time.Time + ID int + LastCommentAt time.Time + LastCommentAuthor sql.NullString + SectionName string + SectionSlug string + Slug string + Sticky bool + Title string + ViewsCount int + type ForumTopicSection struct + Name string + Slug string + type Taxonomy interface + NodeTermsByID func(ctx context.Context, nodeID int) (modulekit.TaxonomyTerms, error) + TermByID func(ctx context.Context, id int) (*modulekit.TaxonomyTerm, error) + TermBySlug func(ctx context.Context, slug string) (*modulekit.TaxonomyTerm, error) + TermsByVocabularyID func(ctx context.Context, vocabularyID int) (modulekit.TaxonomyTerms, error) + UpdateNodeTerms func(ctx context.Context, nodeID int, termIDs []int) error + VocabularyByID func(ctx context.Context, id int) (*modulekit.TaxonomyVocabulary, error)