helpers

package
v0.0.0-...-0a3e258 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateID

func GenerateID() string

GenerateID returns random UUID in a form of string.

func GetDatabaseFile

func GetDatabaseFile() string

GetDatabaseFile returns string with database file. Doesn't work with cross compiling!

func GetHomeFolder

func GetHomeFolder() string

GetHomeFolder returns string with current user's home folder Doesn't work with cross compiling!

func GetIPAdress

func GetIPAdress(r *http.Request) string

GetIPAdress returns IP after processing it, looking for not private networks and headers from proxies.

func JoinStrings

func JoinStrings(strs ...string) string

JoinStrings concants the strings in somewhat efficient way. Appends new line on the end. (or at least better than +=)

func LogCookieNotFound

func LogCookieNotFound(r *http.Request, cookie *http.Cookie, ID string)

LogCookieNotFound is exported to be easly changeable.

func LogCreatedPaste

func LogCreatedPaste(r *http.Request, generatedID string)

LogCreatedPaste is exported to be easly changeable.

func LogDBFileTooBig

func LogDBFileTooBig(t time.Time)

LogDBFileTooBig is exported to be easly changeable.

func LogError

func LogError(err error)

LogError is exported to be easly changeable.

func LogFailedDelete

func LogFailedDelete(r *http.Request, password string, ID string)

LogFailedDelete is exported to be easly changeable.

func LogFailedLogin

func LogFailedLogin(r *http.Request, password string)

LogFailedLogin is exported to be easly changeable.

func LogParsingFileError

func LogParsingFileError()

LogParsingFileError is exported to be easly changeable.

func LogPasteFolderTooBig

func LogPasteFolderTooBig(t time.Time)

LogPasteFolderTooBig is exported to be easly changeable.

func LogPasteNotFound

func LogPasteNotFound(r *http.Request, ID string)

LogPasteNotFound is exported to be easly changeable.

func LogPasteNotFoundDelete

func LogPasteNotFoundDelete(r *http.Request, ID string)

LogPasteNotFoundDelete is exported to be easly changeable.

func LogRequestID

func LogRequestID(r *http.Request, ID string)

LogRequestID is exported to be easly changeable.

func LogSuccessfulDelete

func LogSuccessfulDelete(r *http.Request, ID string)

LogSuccessfulDelete is exported to be easly changeable.

func LogSuccessfulLogin

func LogSuccessfulLogin(r *http.Request)

LogSuccessfulLogin is exported to be easly changeable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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