server

package module
v0.0.0-...-4462017 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFs embed.FS
View Source
var Time0 time.Time

Time0 represents initial time when we started 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

Functions

func Bottom

func Bottom(c *gin.Context) string

helper function to provide bottom.tmpl HTML

func CaptchaHandler

func CaptchaHandler() gin.HandlerFunc

CaptchaHandler provides access to captcha server

func ErrorTmpl

func ErrorTmpl(c *gin.Context, msg string, err error) string

ErrorTmpl provides error template message

func FAQHandler

func FAQHandler(c *gin.Context)

FAQHandler handlers FAQ requests

func HandleError

func HandleError(c *gin.Context, msg string, err error)

HandlerError handles http server errors

func MakeTmpl

func MakeTmpl(c *gin.Context, title string) utils.TmplRecord

helper function to make initial template struct

func StatusHandler

func StatusHandler(c *gin.Context)

StatusHandler represents /status end-point

func SuccessTmpl

func SuccessTmpl(c *gin.Context, msg string) string

SuccessTmpl provides success template message

func Top

func Top(c *gin.Context) string

helper function to provide top.tmpl HTML

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