glu

package module
v0.0.0-...-a04ab8f Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

README

glu

pipeline status coverage report top level coverage Go Report Card Documentation
Set of reusable low level utilities / functions for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrContains

func ArrContains(arr []string, value string) bool

ArrContains returns true if string is contained in string array

func FileExists

func FileExists(path string) bool

FileExists returns rue if the file exists

func GetContentType

func GetContentType(filename string) string

GetContentType returns mime type (content-type) for given filename

func Marshall

func Marshall(data interface{}, fileName string) (resultErr error)

Marshall turn data into yaml file

func MkFile

func MkFile(path string, fileContents string) string

MkFile Creates a file with given content

func MkTempDir

func MkTempDir(dirSuffix string) string

MkTempDir Creates a temporary directory and returns path to it

func MkTempFile

func MkTempFile(fileName string, fileContents string) string

MkTempFile Creates a temporary file with provided string content, returns path

func ParsePath

func ParsePath(path string) (result string)

ParsePath takes human readable path (relative or absolute, with ~) and returns it to absolute path Main motivation is to turn ~ to home directory

func ReadFile

func ReadFile(path string) ([]byte, error)

ReadFile returns contents of the file. It uses ParsePath at the top of standard ioutil.ReadFile

func Unmarshall

func Unmarshall(fileName string, out interface{}) (resultErr error)

Unmarshall turns yaml file into data

Types

This section is empty.

Jump to

Keyboard shortcuts

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