utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFile

func AppendFile(dir, filename string, data []byte, offset int64) error

AppendFile func

func CopyFile

func CopyFile(src, dst string, force bool) error

CopyFile from a location to another location

func CreateDir

func CreateDir(dir string) error

CreateDir func

func GetFileInfo

func GetFileInfo(filename string) (*types.File, error)

func GetLogger

func GetLogger(level, encoding string, showFullCaller bool, callerSkip int, enableStacktrace bool) *zap.Logger

GetLogger returns a logger

func IsDirExists

func IsDirExists(dirname string) bool

IsDirExists checks the directory availability

func IsFileExists

func IsFileExists(filename string) bool

IsFileExists checks the file availability

func RemoveFile

func RemoveFile(file string) error

removes the file

func StructToMap

func StructToMap(data interface{}) map[string]interface{}

StructToMap converts struct to a map

func ToDuration

func ToDuration(duration string, defaultDuration time.Duration) time.Duration

ToDuration converts the string duration to time.Duration, if failed returns the default

func WriteFile

func WriteFile(dir, filename string, data []byte) error

WriteFile func

Types

This section is empty.

Jump to

Keyboard shortcuts

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