utils

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: ISC Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateMD5

func CalculateMD5(bytes []byte) string

CalculateMD5 calculates an MD5 hex string

func CalculateSHA1

func CalculateSHA1(bytes []byte) string

CalculateSHA1 calculates a SHA1 hex string

func CopyFile

func CopyFile(src, dst string) (int64, error)

CopyFile safely copy a file

func DataDir

func DataDir(name string) (string, error)

DataDir return a data directory for the current program

func DirectoryExists

func DirectoryExists(path string) (bool, error)

DirectoryExists checks for existence of a file at path

func FileExists

func FileExists(path string) (bool, error)

FileExists checks for existence of a file at path

func GetDifficultyRank

func GetDifficultyRank(difficulty string) int

GetDifficultyRank get difficulty rank number from string

func GetDifficultyString

func GetDifficultyString(rank int) string

GetDifficultyString get difficulty string from rank number

func GetOldDifficultyRank

func GetOldDifficultyRank(rank int) int

GetOldDifficultyRank get old difficulty rank number from new rank

func NeedsMappingExtensions

func NeedsMappingExtensions(diff *types.OldDifficultyJSON) bool

NeedsMappingExtensions Checks for mapping extensions requirement

func OpenFileSafe

func OpenFileSafe(path string) (*os.File, error)

OpenFileSafe creates all nested directories then opens the file

func PathExists

func PathExists(path string) (bool, error)

PathExists checks for existence of an item at path

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice checks for a string in a slice of strings

func StripQuotes

func StripQuotes(s string) string

StripQuotes from a string

Types

This section is empty.

Jump to

Keyboard shortcuts

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