Documentation ¶
Index ¶
- Variables
- func StrToBool(s string) bool
- type Config
- type OwnTickets
- func (o *OwnTickets) AdminPage(w http.ResponseWriter, r *http.Request)
- func (o *OwnTickets) CheckAdminCookie(w http.ResponseWriter, r *http.Request, require bool) (isAdmin bool)
- func (o *OwnTickets) CreateTicketPage(w http.ResponseWriter, r *http.Request)
- func (o *OwnTickets) Error(w http.ResponseWriter, code int, codeMsg string, err string)
- func (o *OwnTickets) LoginPage(w http.ResponseWriter, r *http.Request)
- func (o *OwnTickets) LogoutPage(w http.ResponseWriter, r *http.Request)
- func (o *OwnTickets) Run() error
- func (o *OwnTickets) SetAdminCookie(w http.ResponseWriter, r *http.Request, isAdmin bool)
- func (o *OwnTickets) SetupCookies() (err error)
- func (o *OwnTickets) SetupDatabase() error
- func (o *OwnTickets) SetupRouter() error
- func (o *OwnTickets) SetupTemplates() (err error)
- func (o *OwnTickets) ViewTicketPage(w http.ResponseWriter, r *http.Request)
- type TicketForm
Constants ¶
This section is empty.
Variables ¶
View Source
var Templates embed.FS
Functions ¶
Types ¶
type Config ¶
type Config struct { PasswordHash string `json:"passwordHash"` RequirePasswordForTicketCreation bool `json:"requirePasswordForTicketCreation"` TicketCreationPasswordHash string `json:"ticketCreationPasswordHash"` Database string `json:"database"` }
func (*Config) LoadFromEnv ¶
func (c *Config) LoadFromEnv()
func (*Config) LoadFromFile ¶
type OwnTickets ¶
type OwnTickets struct { Config Config Database *gorm.DB Router http.Handler Cookie *securecookie.SecureCookie TicketCreateTemplate *pongo2.Template TicketViewTemplate *pongo2.Template ErrorTemplate *pongo2.Template LoginTemplate *pongo2.Template AdminTemplate *pongo2.Template }
func (*OwnTickets) AdminPage ¶
func (o *OwnTickets) AdminPage(w http.ResponseWriter, r *http.Request)
func (*OwnTickets) CheckAdminCookie ¶
func (o *OwnTickets) CheckAdminCookie(w http.ResponseWriter, r *http.Request, require bool) (isAdmin bool)
func (*OwnTickets) CreateTicketPage ¶
func (o *OwnTickets) CreateTicketPage(w http.ResponseWriter, r *http.Request)
func (*OwnTickets) Error ¶
func (o *OwnTickets) Error(w http.ResponseWriter, code int, codeMsg string, err string)
func (*OwnTickets) LoginPage ¶
func (o *OwnTickets) LoginPage(w http.ResponseWriter, r *http.Request)
func (*OwnTickets) LogoutPage ¶
func (o *OwnTickets) LogoutPage(w http.ResponseWriter, r *http.Request)
func (*OwnTickets) Run ¶
func (o *OwnTickets) Run() error
func (*OwnTickets) SetAdminCookie ¶
func (o *OwnTickets) SetAdminCookie(w http.ResponseWriter, r *http.Request, isAdmin bool)
func (*OwnTickets) SetupCookies ¶
func (o *OwnTickets) SetupCookies() (err error)
func (*OwnTickets) SetupDatabase ¶
func (o *OwnTickets) SetupDatabase() error
func (*OwnTickets) SetupRouter ¶
func (o *OwnTickets) SetupRouter() error
func (*OwnTickets) SetupTemplates ¶
func (o *OwnTickets) SetupTemplates() (err error)
func (*OwnTickets) ViewTicketPage ¶
func (o *OwnTickets) ViewTicketPage(w http.ResponseWriter, r *http.Request)
type TicketForm ¶
type TicketForm struct { Name string `schema:"name"` Email string `schema:"email"` Title string `schema:"title"` Content string `schema:"content"` Priority int `schema:"priority"` Password string `schema:"password"` }
func (*TicketForm) Validate ¶
func (t *TicketForm) Validate() map[string]string
Click to show internal directories.
Click to hide internal directories.