commons

package
v0.0.0-...-7466d73 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentGet

func ContentGet(filename string) (int, string, error)

ContentGet gets content of file

func ContentWrite

func ContentWrite(w http.ResponseWriter, filename string)

ContentWrite Writes content of file to w

func CreateLockFile

func CreateLockFile(fn string)

CreateLockFile creates a lock file at the specified address

func DeleteLockFile

func DeleteLockFile(fn string)

DeleteLockFile deletes a lock file

func FileExists

func FileExists(filename string) bool

FileExists Checks if a file exists

func FolderExists

func FolderExists(folderPath string) bool

FolderExists Checks if a file exists

func GetIP

func GetIP(r *http.Request) string

GetIP gets a requests IP address by reading off the forwarded-for header (for proxies) and falls back to use the remote address.

func GetScheme

func GetScheme(r *http.Request) string

GetScheme returns the scheme of the path of the given request

func MustOpen

func MustOpen(f string) *os.File

MustOpen opens a file and panics if it fails

func NewFileUploadRequest

func NewFileUploadRequest(url string, values map[string]io.Reader) (*http.Request, error)

NewFileUploadRequest Creates a new file upload http request with optional extra params

func RandomString

func RandomString(n int) string

RandomString generates a string of n characters

Types

This section is empty.

Jump to

Keyboard shortcuts

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