util

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package util contains helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileRePattern

func CompileRePattern(pattern string) *regexp.Regexp

CompileRePattern compiles a string containing a regular expression

func GetEnvParameter

func GetEnvParameter(name string, mandatory bool) string

GetEnvParameter returns the value of an environment variable

func MakeDirIfNotExists

func MakeDirIfNotExists(directory string) error

MakeDirIfNotExists creates a directory if it does not exist yet

func RandToken added in v0.2.2

func RandToken(n int) (string, error)

RandToken generates a random hex value.

func ReadFile

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

ReadFile reads a file from the file system

func ReadLinesFromFile

func ReadLinesFromFile(name string) []string

ReadLinesFromFile reads a file and returns a string slice containing the lines

func SaveFile

func SaveFile(name string, data []byte) error

SaveFile saves a file to the file system

Types

This section is empty.

Jump to

Keyboard shortcuts

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