Documentation
¶
Index ¶
Constants ¶
View Source
const JS = `` /* 137-byte string literal not displayed */
View Source
const JS_IMG = `` /* 156-byte string literal not displayed */
View Source
const NUMBER_TEMPLATE = `<image x="%d" y="0" width="%d" height="%d" xlink:href="data:image/%s;base64,%s" />`
View Source
const SVG_TEMPLATE = `` /* 243-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func AdminMiddleware ¶ added in v0.0.2
func AdminMiddleware(next http.Handler, ad *AdminPanel) http.Handler
Middleware to check whether admin is enabled in the config file if not enabled, return 404 to disguise as nothing
func BuildCounterImg ¶
func LoadAssets ¶
func LoadAssets(path string)
func LoadImgage ¶
func LoadImgage(path string)
Types ¶
type AdminPanel ¶ added in v0.0.2
type AdminPanel struct {
Enabled bool
SecretKey []byte
Mu sync.Mutex
// contains filtered or unexported fields
}
func (*AdminPanel) Register ¶ added in v0.0.2
func (a *AdminPanel) Register()
type Server ¶
type Server struct {
Config *common.Config
DB database.IDatabase
AdminEn *AdminPanel
}
func (*Server) AdminGetHndl ¶ added in v0.0.2
func (s *Server) AdminGetHndl(w http.ResponseWriter, r *http.Request)
func (Server) AdminHndl ¶ added in v0.0.2
func (s Server) AdminHndl(w http.ResponseWriter, r *http.Request)
func (*Server) AdminUpdateHndl ¶ added in v0.0.2
func (s *Server) AdminUpdateHndl(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.