server

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Time0 time.Time

Time0 represents initial time when we started the server

View Source
var TotalDeleteRequests uint64

TotalDeleteRequests counts total number of DELETE requests received by the server

View Source
var TotalGetRequests uint64

TotalGetRequests counts total number of GET requests received by the server

View Source
var TotalPostRequests uint64

TotalPostRequests counts total number of POST requests received by the server

View Source
var TotalPutRequests uint64

TotalPutRequests counts total number of PUT requests received by the server

Functions

func CaptchaHandler

func CaptchaHandler() gin.HandlerFunc

CaptchaHandler provides access to captcha server

func CounterMiddleware

func CounterMiddleware() gin.HandlerFunc

CounterMiddleware counts GET/POST/PUT/DELETE requests

func ErrorPage

func ErrorPage(fsys fs.FS, msg string, err error) string

ErrorPage returns error page

func ErrorTmpl

func ErrorTmpl(fsys fs.FS, msg string, err error) string

ErrorTmpl provides error template message

func FAQFAQPage

func FAQFAQPage(fsys fs.FS) string

FAQPage provides FAQ page

func FooterPage

func FooterPage(fsys fs.FS) string

FooterPage returns footer page

func HeaderPage

func HeaderPage(fsys fs.FS) string

HeaderPage returns header page

func MakeTmpl

func MakeTmpl(fsys fs.FS, title string) utils.TmplRecord

helper function to make initial template struct

func MetricsPage

func MetricsPage(fsys fs.FS) string

MetricsPage represents metrics page

func SuccessTmpl

func SuccessTmpl(fsys fs.FS, msg string) string

SuccessTmpl provides success template message

Types

type Mem

type Mem struct {
	Virtual Memory
	Swap    Memory
}

Mem structure keeps track of virtual/swap memory of the server

type Memory

type Memory struct {
	Total       uint64  `json:"total"`
	Free        uint64  `json:"free"`
	Used        uint64  `json:"used"`
	UsedPercent float64 `json:"usedPercent"`
}

Memory structure keeps track of server memory

Jump to

Keyboard shortcuts

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