server

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 20 Imported by: 0

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 AuthMiddleware added in v0.0.2

func AuthMiddleware(next http.Handler) http.Handler

func BuildCounterImg

func BuildCounterImg(c string) string

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 Image

type Image struct {
	// contains filtered or unexported fields
}

type Server

type Server struct {
	Config  *common.Config
	DB      database.IDatabase
	AdminEn *AdminPanel
}

func NewInstance

func NewInstance(config *common.Config, db database.IDatabase) *Server

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)

func (Server) AuthHndl added in v0.0.2

func (s Server) AuthHndl(w http.ResponseWriter, r *http.Request)

func (Server) Start

func (s Server) Start()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL