Documentation
¶
Index ¶
- Constants
- func CheckVersion() bool
- func CreateOrSave(entity *Entity) int64
- func GetConfigByPageType[T any](pageType string, defaultValue T) T
- func GetConfigByPageTypeE[T any](pageType string, defaultValue T) (T, error)
- func SyncVersion()
- type AnnouncementConfig
- type Entity
- type FooterInfo
- type FooterItem
- type FriendLinksGroup
- type LinkItem
- type MailSettingsConfig
- type PItem
- type PostingContent
- type SecurityAndRegistration
- type SiteSettingsConfig
- type SponsorItem
- type Sponsors
- type SponsorsConfig
- type UserSponsor
Constants ¶
View Source
const ( FriendShipLinks = `friendShipLinks` SponsorsPage = `sponsors` SiteSettings = `siteSettings` EmailSettings = `emailSetting` Announcement = `announcement` SecuritySettings = `securitySettings` PostingSettings = `postingSettings` Version = `version` )
View Source
const GooseForumVersion = 0
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶ added in v0.0.10
func CheckVersion() bool
func CreateOrSave ¶
func GetConfigByPageType ¶ added in v0.0.5
func GetConfigByPageTypeE ¶ added in v0.0.8
func SyncVersion ¶ added in v0.0.10
func SyncVersion()
Types ¶
type AnnouncementConfig ¶ added in v0.0.9
type AnnouncementConfig struct {
Enabled bool `json:"enabled"` // 是否启用公告
Content string `json:"content"` // 公告内容
HtmlContent string `json:"-"` // 预渲染后的 HTML,仅服务端使用
}
AnnouncementConfig 公告设置配置
func (AnnouncementConfig) GetHtmlContent ¶ added in v0.1.2
func (itself AnnouncementConfig) GetHtmlContent() string
func (*AnnouncementConfig) PrepareHTML ¶ added in v0.1.2
func (itself *AnnouncementConfig) PrepareHTML()
type Entity ¶
type Entity struct {
Id uint64 `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"` // 主键
PageType string `gorm:"column:page_type;uniqueIndex;type:varchar(128);not null;default:'';" json:"pageType"` // 页面类型
Config string `gorm:"column:config;type:text;" json:"content"` //
CreatedAt time.Time `gorm:"column:created_at;index;autoCreateTime;<-:create;" json:"createdAt"` //
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}
func GetByPageType ¶
type FooterInfo ¶ added in v0.1.1
type FooterInfo struct {
}
type FooterItem ¶ added in v0.0.8
type FooterItem struct {
}
type FriendLinksGroup ¶ added in v0.0.5
type MailSettingsConfig ¶ added in v0.0.8
type MailSettingsConfig struct {
// SMTP服务器设置
EnableMail bool `json:"enableMail"`
SmtpHost string `json:"smtpHost"`
SmtpPort int `json:"smtpPort"`
UseSSL bool `json:"useSSL"`
SmtpUsername string `json:"smtpUsername"`
SmtpPassword string `json:"smtpPassword"`
FromName string `json:"fromName"`
FromEmail string `json:"fromEmail"`
}
MailSettingsConfig 邮件设置配置
type PostingContent ¶ added in v0.1.1
type PostingContent struct {
TextControl struct {
MinPostLength int `json:"minPostLength"`
MaxPostLength int `json:"maxPostLength"`
MinTitleLength int `json:"minTitleLength"`
MaxTitleLength int `json:"maxTitleLength"`
NewUserPostCooldownMinutes int `json:"newUserPostCooldownMinutes"`
} `json:"textControl"`
UploadControl struct {
AllowAttachments bool `json:"allowAttachments"`
AuthorizedExtensions []string `json:"authorizedExtensions"`
MaxAttachmentSizeKb int `json:"maxAttachmentSizeKb"`
MaxDailyUploadsPerUser int `json:"maxDailyUploadsPerUser"`
NewUserUploadCooldownMinutes int `json:"newUserUploadCooldownMinutes"`
} `json:"uploadControl"`
}
type SecurityAndRegistration ¶ added in v0.1.1
type SiteSettingsConfig ¶ added in v0.0.8
type SiteSettingsConfig struct {
// 站点基本信息
SiteName string `json:"siteName"`
SiteLogo string `json:"siteLogo"`
SiteDescription string `json:"siteDescription"`
SiteKeywords string `json:"siteKeywords"`
SiteUrl string `json:"siteUrl"`
SiteEmail string `json:"siteEmail"`
ExternalLinks string `json:"externalLinks,omitempty"`
// 品牌标识类型: default(默认样式), text(自定义文字), image(图片)
BrandType string `json:"brandType"`
BrandText string `json:"brandText"`
BrandImage string `json:"brandImage"`
}
SiteSettingsConfig 站点设置配置
type SponsorItem ¶ added in v0.0.8
type Sponsors ¶ added in v0.0.8
type Sponsors struct {
Level0 []SponsorItem `json:"level0"`
Level1 []SponsorItem `json:"level1"`
Level2 []SponsorItem `json:"level2"`
Level3 []SponsorItem `json:"level3"`
}
type SponsorsConfig ¶ added in v0.0.8
type SponsorsConfig struct {
Sponsors Sponsors `json:"sponsors"`
Users []UserSponsor `json:"users"`
}
Click to show internal directories.
Click to hide internal directories.