utils

package
v0.0.0-...-1861fbc Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFile = "gosint"

ConfigFile is the name of the configuration file

Variables

View Source
var (
	// ConfigFilePath defines the path where the standard configuration file will be written
	ConfigFilePath = os.Getenv("HOME") + "/.config/"
)

Functions

func CreateDirectory

func CreateDirectory(dirname string)

CreateDirectory creates a directory in the path passed as argument

func FileExists

func FileExists(file string) bool

FileExists return true if the path exists

func GetConfigValue

func GetConfigValue(key string) string

GetConfigValue take as input a key value and will return the relative value set in the configuration file

func RetrieveRequestBody

func RetrieveRequestBody(domain string) string

RetrieveRequestBody send a Get Request to a domain and return the body casted to string

func SetToSlice

func SetToSlice(oldset mapset.Set) []string

SetToSlice convers a set in a slice of strings and then order them

func SimpleQuestion

func SimpleQuestion(question string) bool

SimpleQuestion prompt a simple Y/N question

func WriteConfigFile

func WriteConfigFile(key string, value string)

WriteConfigFile will write default values in the config file specifiend in var_os.go

func WriteOnFile

func WriteOnFile(filename string, text string)

WriteOnFile open a file with Append and write on it, if the file doesn't exist will create it

Types

This section is empty.

Jump to

Keyboard shortcuts

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