util

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chown

func Chown(file, user string) error

Chown changes owner

func CreateUser

func CreateUser(name string) error

CreateUser will create a normal user by name

func DropRunAs

func DropRunAs(name string, debug bool, files ...*os.File) (*os.Process, error)

DropRunAs will drop root previlidge and run as a normal user

func GetDbValidatorInterval

func GetDbValidatorInterval() int

GetDbValidatorInterval getter for db validator interval

func GetUserGUID

func GetUserGUID(name string) (int, int, error)

GetUserGUID give user's GUID

func HasElem

func HasElem(s interface{}, elem interface{}) bool

HasElem Helper function to find if a elem in a slice

func IsRegularFile

func IsRegularFile(path string) (bool, error)

IsRegularFile checks if given path point to a file - not to symlink nor directory

func IsUserExist

func IsUserExist(name string) bool

IsUserExist check if user exist on host

func SubtractStringSlice

func SubtractStringSlice(slice, s []string) []string

SubtractStringSlice remove string from slice

func UnifyMapParamsTypes

func UnifyMapParamsTypes(pluginParams map[string]interface{}) (map[string]interface{}, error)

UnifyMapParamsTypes responsible to unify types of parameters in map to avoid misleading types when passing values to plugins Example: 3.0 can be json.Number but should be float RMD plugins expects following type of params: => int64 (for integers) => float64 (for real numbers) => bool => string => nil => []float64 => []int64 => interface{}

Types

This section is empty.

Directories

Path Synopsis
acl
log

Jump to

Keyboard shortcuts

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