utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(dirName string) bool

func DoRequest

func DoRequest(app App, method, url, body string) (*http.Response, int, string, error)

func FileExists

func FileExists(filename string) bool

func Hash

func Hash(content string) []byte

func HashBytes

func HashBytes(content ...[]byte) []byte

func Lock

func Lock(resource string) (func() error, error)

Lock resource if viper returns it should be locked.

func LogDebug

func LogDebug(message string, fields ...zap.Field)

func LogError

func LogError(message string, fields ...zap.Field)

func LogFatal

func LogFatal(message string, fields ...zap.Field)

func LogInfo

func LogInfo(message string, fields ...zap.Field)

func LogWarn

func LogWarn(message string, fields ...zap.Field)

func LoggerInstance

func LoggerInstance() *zap.Logger

func LoggerWith

func LoggerWith(fields ...zap.Field) *zap.Logger

func RandString

func RandString(n int) string

RandString with n characters

func SetDebug

func SetDebug()

func SetTestStorage

func SetTestStorage()

Types

type App

type App interface {
	GetRouter() *router.Router
}

Jump to

Keyboard shortcuts

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