common

package
v0.0.0-...-122e282 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LayoutPath string = "templates/layout.html"

LayoutPath Defines the path of the layout template page

Variables

View Source
var CurrentPage = ""

CurrentPage Defines the calling page rendering the template (to handle active links)

View Source
var Templates *template.Template

Templates Allows access to the template pointer from the entire application

Functions

func CheckError

func CheckError(err error, level int)

CheckError Handles the type of error

  • 0 = Info
  • 1 = Warning
  • 2 = Error - should be most common
  • 3 = Fatal

func GetParam

func GetParam(name string) string

GetParam Returns the parameter value from its name

func InitParams

func InitParams()

InitParams Initializes the parameters from the .env file

func LogAccess

func LogAccess(w http.ResponseWriter, req *http.Request, duration time.Duration)

LogAccess Creates the log of access request

Types

type AccessLog

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

AccessLog Defines the structure of log access request objects

Jump to

Keyboard shortcuts

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