common

package
v0.0.0-...-bdf6f31 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUUID

func CreateUUID() (uuid string)

CreateUUID a random UUID with from RFC 4122 adapted from http://github.com/nu7hatch/gouuid

func Encrypt

func Encrypt(plaintext string) (cryptext string)

Encrypt plaintext with SHA-1

func ExportJSON

func ExportJSON(d interface{}, w io.Writer) (err error)

ExportJSON exports a json data to an output

func If

func If(cond bool, trueVal, falseVal interface{}) interface{}

If implements an altenative of ?: operator

func LoadJSON

func LoadJSON(r io.Reader, d interface{}) (err error)

LoadJSON parses an input into specific data by using JSON format

func NewError

func NewError(mod, pack, foo, body string) (err error)

NewError creates a new ModuleError

Types

type ModuleError

type ModuleError struct {
	// contains filtered or unexported fields
}

ModuleError represents an error from specific module and package

func (ModuleError) Error

func (err ModuleError) Error() string

Error string of given ModuleError

Jump to

Keyboard shortcuts

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