util

package
v0.0.0-...-3bdff8d Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create_dir_if_not_exists

func Create_dir_if_not_exists(path_to_dir string)

func GetRandomStringBASE64

func GetRandomStringBASE64() string

used for creating new session tokens

func GetSHA1sum

func GetSHA1sum(bytes []byte) string

used for checking if text was modified

func GetSHA1sumOfFile

func GetSHA1sumOfFile(filename string) (string, error)

used to check if file was modified while user was editing it

func GetUsernameFromRequest

func GetUsernameFromRequest(r *http.Request) string

This function assumes the user is already logged in.

func MatchRegex

func MatchRegex(s string, r *regexp.Regexp) ([]string, error)

func WriteBodyNoRefresh

func WriteBodyNoRefresh(w http.ResponseWriter, bytes []byte)

func WriteHTTPNoRefreshResponse

func WriteHTTPNoRefreshResponse(w http.ResponseWriter, errorcode int, msg string)

func WriteHTTPResponse

func WriteHTTPResponse(w http.ResponseWriter, errorcode int, msg string)

func WriteHeaderNoCache

func WriteHeaderNoCache(w http.ResponseWriter)

Types

This section is empty.

Jump to

Keyboard shortcuts

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