helper

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2020 License: MIT Imports: 10 Imported by: 0

README

Helper

Useful golang functions

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(path string) ([]byte, error)

File reads data from file

func GenKey

func GenKey()

GenKey Generates random 64 character string

func GetContentType

func GetContentType(file *os.File) (string, error)

GetContentType returns content mime type of file

func Hostname

func Hostname(ip net.IP) ([]string, error)

Hostname returns hostname

func IP

func IP(r *http.Request) (net.IP, error)

IP returns IP address from requester

func UploadFile

func UploadFile(dir string, uuid uint64, file multipart.File, fileHeader *multipart.FileHeader) error

UploadFile Create file from multpart form

func WriteFile

func WriteFile(path string, data []byte) error

WriteFile Writes byte data to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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