goutils

package module
v0.0.0-...-13ba47e Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 15 Imported by: 0

README

go-utils

A collection of utils for golang I have written for go over the years, actually in a repo and not copy/pasted between projects.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStringToFile

func AppendStringToFile(str string, file string)

AppendStringToFile appends a string to a file, or creates a new file with the string if the file does not exist

func DeleteDir

func DeleteDir(dir string) error

func Download

func Download(url string) ([]byte, error)

func DownloadString

func DownloadString(url string) (string, error)

func DownloadURL

func DownloadURL(url string, file string) bool

func ExtractZip

func ExtractZip(zip string, dest string)

func FileExists

func FileExists(file string) bool

FileExists checks to see if a file exists

func FormatPath

func FormatPath(path string) string

func GetDataMap

func GetDataMap(jsonStr string) map[string]interface{}

func GetQuery

func GetQuery(jsonStr string) *jsonq.JsonQuery

func GetRunPath

func GetRunPath() string

func GetStringValue

func GetStringValue(jsonStr string, key string) string

func MakeDir

func MakeDir(fileName string)

func ReadLinesFromFile

func ReadLinesFromFile(fileName string) []string

ReadLinesFromFile reads each line of the file into a string array

func ReadStringFromFile

func ReadStringFromFile(file string) string

ReadStringFromFile reads a string from a file

func ToJson

func ToJson(i interface{}) string

func WriteStringToFile

func WriteStringToFile(str string, file string)

WriteStringToFile writes a string to a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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