Documentation
¶
Index ¶
- type Admin
- type Base
- type Config
- type EmailConfig
- type EmailMessenger
- type Field
- type File
- type Index
- type InfoPage
- type MatrixConfig
- type MatrixMessenger
- type Message
- type MessagingConfig
- type Messenger
- type NewTopicPage
- type Report
- type ReportPage
- type ReportState
- type ReportsOfTopicPage
- type Role
- type Topic
- type UserRole
- type WebhookConfig
- type WebhookMessenger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Port int `yaml:"port"`
Mode string `yaml:"mode"`
Content struct {
Title i18n.Translatable `yaml:"title"`
SubTitle i18n.Translatable `yaml:"subtitle"`
Logo string `yaml:"logo"`
AdminUsers []string `yaml:"adminUsers"` // e.g. ge42tum
} `yaml:"content"`
HTTPS struct {
Port int `yaml:"port"`
Cert string `yaml:"cert"`
Key string `yaml:"key"`
} `yaml:"https"`
FileDir string `yaml:"fileDir"`
URL string `yaml:"URL"`
Saml struct {
IdpMetadataURL string `yaml:"idpMetadataURL"`
EntityID string `yaml:"entityID"`
RootURL string `yaml:"rootURL"`
Cert struct {
Org string `yaml:"org"`
Country string `yaml:"country"`
Province string `yaml:"province"`
Locality string `yaml:"locality"`
StreetAddress string `yaml:"streetAddress"`
PostalCode string `yaml:"postalCode"`
Cn string `yaml:"cn"`
} `yaml:"cert"`
} `yaml:"saml"`
Mail struct {
User string `yaml:"user"`
Password string `yaml:"password"`
SMTPServer string `yaml:"smtpServer"`
SMTPPort string `yaml:"smtpPort"`
From string `yaml:"from"`
FromName string `yaml:"fromName"`
} `yaml:"mail"`
Imprint string `yaml:"imprint"`
Privacy string `yaml:"privacy"`
}
func (Config) GetImprint ¶
func (Config) GetPrivacy ¶
type EmailConfig ¶
type EmailMessenger ¶
type EmailMessenger struct {
// contains filtered or unexported fields
}
func NewEmailMessenger ¶
func NewEmailMessenger(config EmailConfig) *EmailMessenger
func (*EmailMessenger) SendMessage ¶
func (m *EmailMessenger) SendMessage(title string, message Message, reportURL string) error
type Field ¶
type Field struct {
ID uint `gorm:"primarykey"`
TopicID uint
Name i18n.Translatable `yaml:"name" gorm:"embedded;embeddedPrefix:name_"`
Type string `yaml:"type"` // e.g. file, text, email, textarea,
Required bool `yaml:"required"`
Description i18n.Translatable `yaml:"description" gorm:"embedded;embeddedPrefix:description_"`
// For select inputs:
Choices *[]string `yaml:"choices" gorm:"-"`
ChoicesStr string `gorm:"choices"`
}
type File ¶
type MatrixConfig ¶
type MatrixMessenger ¶
type MatrixMessenger struct {
// contains filtered or unexported fields
}
func NewMatrixMessenger ¶
func NewMatrixMessenger(config MatrixConfig) *MatrixMessenger
func (*MatrixMessenger) SendMessage ¶
func (m *MatrixMessenger) SendMessage(title string, message Message, reportURL string) error
type Message ¶
type MessagingConfig ¶
type MessagingConfig interface {
}
MessagingConfig is a generic type for a messenger configuration
type Messenger ¶
Messenger is an interface for all messaging clients capable of sending a message
func GetMessengers ¶
type NewTopicPage ¶
type NewTopicPage struct {
Base
}
type Report ¶
type Report struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
TopicID uint
ReporterToken string `gorm:"type:varchar(255);not null"`
AdministratorToken string `gorm:"type:varchar(255);not null"`
Messages []Message `gorm:"foreignKey:ReportID;constraint:OnDelete:CASCADE"`
State ReportState
Creator *string `gorm:"type:varchar(512)"` // optional email address
}
func (*Report) GetStatusColor ¶
func (*Report) GetStatusText ¶
type ReportPage ¶
type ReportState ¶
type ReportState string
const ( ReportStateOpen ReportState = "open" ReportStateDone ReportState = "done" ReportStateSpam ReportState = "spam" )
type ReportsOfTopicPage ¶
type Topic ¶
type Topic struct {
ID uint `gorm:"primarykey"`
Name i18n.Translatable `yaml:"name" gorm:"embedded;embeddedPrefix:name_"`
Summary i18n.Translatable `yaml:"summary" gorm:"embedded;embeddedPrefix:summary_"`
Fields []Field `yaml:"fields"`
Contacts struct {
Email *EmailConfig `yaml:"email"`
Matrix *MatrixConfig `yaml:"matrix"`
Webhook *WebhookConfig `yaml:"webhook"`
} `yaml:"contacts" gorm:"-"`
Admins []Admin `yaml:"admins" gorm:"many2many:topic_admins;"`
Email string
}
type WebhookConfig ¶
type WebhookConfig struct {
Target string `yaml:"target"`
}
type WebhookMessenger ¶
type WebhookMessenger struct {
// contains filtered or unexported fields
}
func NewWebhookMessenger ¶
func NewWebhookMessenger(config WebhookConfig) *WebhookMessenger
func (*WebhookMessenger) SendMessage ¶
func (m *WebhookMessenger) SendMessage(title string, message Message, reportURL string) error
Click to show internal directories.
Click to hide internal directories.