goutils

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

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 11 Imported by: 5

README

goutils

a package to store some of my utility functions in Golang

Documentation

Overview

some utility functions in Golang

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDbConnectionString

func GetDbConnectionString(db string) (string, error)

func GetEnvOrDefault

func GetEnvOrDefault(key, defVal string) string

func GetFileTextContent

func GetFileTextContent(filename string, FileEncoding string) string

get back the text content of a filename if FileEncoding is used decode the content with this encoding (default is

func GetKeyValue

func GetKeyValue(s, sep string) (string, string)

func GetUUID

func GetUUID() string

Generates a cryptographically secure random 16 bytes UUID using crypto/rand package returns a string of lenght 36 like this : bcaf4890-8b63-423b-258f-7a11004a8bf0 On Linux and FreeBSD, it uses getrandom(2) if available, /dev/urandom otherwise. https://golang.org/pkg/crypto/rand/ For a more classic RFC 4122 v4 GUID you can use https://github.com/satori/go.uuid more info at https://blog.kowalczyk.info/article/JyRZ/generating-good-unique-ids-in-go.html

func NewDBError

func NewDBError(text string) error

New returns an error that formats as the given text.

func PrintCallStack

func PrintCallStack()

Types

This section is empty.

Jump to

Keyboard shortcuts

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