snippets

package
v0.0.0-...-8280380 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicCors

func BasicCors() *cors.Cors

BasicCors returns the default cors options suggested in https://github.com/go-chi/cors

func ChiFileServer

func ChiFileServer(r chi.Router, path string, root http.FileSystem)

ChiFileServer is the fileserver snippet from awesome https://github.com/go-chi/chi

func CreateHTTPServer

func CreateHTTPServer(addr string, hand http.Handler) *http.Server

CreateHTTPServer creates a http server, based on the recommendations from https://blog.cloudflare.com/exposing-go-on-the-internet/

func DirExist

func DirExist(dir string) bool

DirExist checks if directory exist

func EnsureDir

func EnsureDir(dir string)

EnsureDir checks if given directory exist, creates if not

func MD5Hash

func MD5Hash(in string) string

MD5Hash just hashes given string

func SHA256Hash

func SHA256Hash(in string) string

SHA256Hash just hashes given string

Types

This section is empty.

Jump to

Keyboard shortcuts

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