utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CI_COMMIT_SHORT_SHA string
	CI_COMMIT_BRANCH    string
	CI_COMMIT_TAG       string
	CI_TAGGED           bool
	CI_BUILD            bool
)
View Source
var (
	HOST      string
	PORT      string
	HTTPS     string
	PROXY     bool
	URL       string
	REDIS_URI string
	ESTATS    string
)
View Source
var ConfigLimiter limiter.Config = limiter.Config{
	Max:        10,
	Expiration: 60 * time.Second,
	LimitReached: func(c *fiber.Ctx) error {
		if c.Get("content-type") == "application/json" {
			return c.Status(418).JSON(fiber.Map{
				"msg":     "Too many requests, slow down I'm a teapot (10 requests per minute)",
				"success": false,
			})
		}
		return c.Render("views/home", fiber.Map{
			"ERR":                 "You have reached the limit of requests! Please check back later. (1 minute)",
			"CI_COMMIT_SHORT_SHA": CI_COMMIT_SHORT_SHA,
			"CI_COMMIT_BRANCH":    CI_COMMIT_BRANCH,
			"CI_BUILD":            CI_BUILD,
		})
	},
}

Functions

func Init_build_vars

func Init_build_vars()

func Init_env_vars

func Init_env_vars()
func Print_Starting_Screen()

Types

This section is empty.

Jump to

Keyboard shortcuts

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