Versions in this module Expand all Collapse all v1 v1.0.0 Apr 4, 2019 Changes in this version + type CORSOptions struct + Headers []string + Methods []string + Origins []string + type CSRFOptions struct + CookieName string + Minutes int + type ContentSecurityPolicy struct + Default []string + Font []string + Script []string + Style []string + type Folders struct + LetsEncrypt string + StaticContent string + Templates string + type Server struct + Config ServerConfig + HTTPServer *http.Server + Router *mux.Router + func NewServer(config ServerConfig) Server + func (s *Server) AddFlashMessage(w http.ResponseWriter, r *http.Request, value string) error + func (s *Server) ApplyTemplate(w http.ResponseWriter, name string, data interface{}) error + func (s *Server) CORS(h http.Handler) http.Handler + func (s *Server) CSP(h http.Handler) http.Handler + func (s *Server) CSRF(h http.Handler) http.Handler + func (s *Server) DB() *sqlx.DB + func (s *Server) ErrorCheck(err error, w http.ResponseWriter, statusCode int, text string) bool + func (s *Server) GetCSRF(w http.ResponseWriter, r *http.Request) template.HTML + func (s *Server) GetCookie(r *http.Request, name string) (string, error) + func (s *Server) GetCurrentUser(r *http.Request) (User, error) + func (s *Server) GetDescription() string + func (s *Server) GetFlashMessages(w http.ResponseWriter, r *http.Request, clear bool) []string + func (s *Server) GetSession(r *http.Request, key string, defaultValue interface{}) (interface{}, error) + func (s *Server) JSON(h http.Handler) http.Handler + func (s *Server) ListenAndServe() error + func (s *Server) LogoutCurrentUser(w http.ResponseWriter, r *http.Request) error + func (s *Server) RegisterSessionType(value interface{}) + func (s *Server) RemoveCookie(w http.ResponseWriter, r *http.Request, name string) error + func (s *Server) ServerErrorCheck(err error, w http.ResponseWriter, r *http.Request) bool + func (s *Server) SetCookie(w http.ResponseWriter, name string, value string, minutes int) error + func (s *Server) SetCurrentUser(w http.ResponseWriter, r *http.Request, user User) error + func (s *Server) SetSession(w http.ResponseWriter, r *http.Request, key string, value interface{}) error + func (s *Server) SetStatus(w http.ResponseWriter, statusCode int, text string) + func (s *Server) UsersOnly(h http.Handler) http.Handler + func (s *Server) XML(h http.Handler) http.Handler + type ServerConfig struct + CORSOptions CORSOptions + CSPOptions ContentSecurityPolicy + CSRFOptions CSRFOptions + DBConnectionString string + ErrorTemplate string + Folders Folders + HandlePanic bool + Hostname string + LogToStdout bool + Logger io.Writer + LoginRoute string + Port int + SessionOptions SessionOptions + StaticPath string + func LoadServerConfig(filename string) (ServerConfig, error) + type SessionOptions struct + CookieKey string + CookieName string + Minutes int + type User struct + Display string + ID int + Role string