util

package
v0.0.0-...-0953be8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(needle string, haystack []string) bool

ContainsString checks whether a list of strings contains a certain search string

func MakeError

func MakeError(c *gin.Context, tpl string, status int, error errors.KitSquidError, args *gin.H)

MakeError creates a new error in Gin

func RandomColor

func RandomColor(seedKey string) string

RandomColor returns a randomly generated color code, using the given random seed

func SendMail

func SendMail(recipient string, content *bytes.Buffer) error

SendMail uses SMTP to send a new e-mail to the given recipient address with the given content

func SendTestMail

func SendTestMail(recipient string) error

SendTestMail uses SMTP to send a new test e-mail for debugging purposes

Types

type TplCtx

type TplCtx struct {
	User      interface{}
	Url       string
	Path      string
	Constants struct {
		FacultyIndex int
		VvzBaseUrl   string
	}
	Alerts       []string
	Errors       []string
	SemesterKeys []string
	Version      string
}

TplCtx represents a collection of all properties to be attached to all templates

Jump to

Keyboard shortcuts

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