Documentation ¶
Index ¶
- Constants
- func BytesToString(b []byte) string
- func CallFunction(name string, params ...interface{}) (result []reflect.Value, err error)
- func CallMethod(i interface{}, methodName string, params []interface{}) (interface{}, interface{})
- func CompressDir(src string, buf io.Writer) (int, error)
- func Contains(slice []string, item string) bool
- func Copy(src, dst string) error
- func CopyDir(source string, dest string) (err error)
- func CopyFile(source string, dest string) (err error)
- func CopySymLink(source, dest string) error
- func CreateDataChecksum(data []byte) string
- func CreateDirIfNotExist(dir string) error
- func CreateFileChecksum(path string) string
- func CreateIfNotExists(dir string, perm os.FileMode) error
- func CreateSha1Key(data []byte) string
- func CreateThumbnail(path string, thumbnailMaxHeight int, thumbnailMaxWidth int) (string, error)
- func DateTimeFromString(str string, layout string) (time.Time, error)
- func DecodeISO8859_1(val string) (string, error)
- func DecodeISO8859_10(val string) (string, error)
- func DecodeISO8859_13(val string) (string, error)
- func DecodeISO8859_14(val string) (string, error)
- func DecodeISO8859_15(val string) (string, error)
- func DecodeISO8859_16(val string) (string, error)
- func DecodeISO8859_2(val string) (string, error)
- func DecodeISO8859_3(val string) (string, error)
- func DecodeISO8859_4(val string) (string, error)
- func DecodeISO8859_5(val string) (string, error)
- func DecodeISO8859_6(val string) (string, error)
- func DecodeISO8859_7(val string) (string, error)
- func DecodeISO8859_8(val string) (string, error)
- func DecodeISO8859_9(val string) (string, error)
- func DecodeKOI8R(val string) (string, error)
- func DecodeKOI8U(val string) (string, error)
- func DecodeWindows1250(val string) (string, error)
- func DecodeWindows1251(val string) (string, error)
- func DecodeWindows1252(val string) (string, error)
- func DecodeWindows1253(val string) (string, error)
- func DecodeWindows1254(val string) (string, error)
- func DecodeWindows1255(val string) (string, error)
- func DecodeWindows1256(val string) (string, error)
- func DecodeWindows1257(val string) (string, error)
- func DecodeWindows1258(val string) (string, error)
- func DomainHasIp(domain string, ip string) bool
- func DownloadFile(URL, fileName string) error
- func Exists(filePath string) bool
- func ExtractTarGz(r io.Reader) (string, error)
- func ExtractTextFromJpeg(path string) (string, error)
- func FileLine() string
- func FindFileByName(path string, name string) ([]string, error)
- func FromBytes(data []byte, typeName string) (interface{}, error)
- func FunctionName() string
- func GenerateUUID(val string) string
- func GetChecksum(values interface{}) string
- func GetEnvironmentVariable(key string) (string, error)
- func GetExecName(path string) string
- func GetFileContentType(out *os.File) (string, error)
- func GetFilePathsByExtension(path string, extension string) []string
- func GetFunction(name string) interface{}
- func GetHostnameIPMap(localIp string) map[string]string
- func GetInstanceOf(typeName string) interface{}
- func GetIpv4(address string) (string, error)
- func GetMD5Hash(text string) string
- func GetPrimaryIPAddress() (string, error)
- func GetProcessIdsByName(name string) ([]int, error)
- func GetProcessRunningStatus(pid int) (*os.Process, error)
- func GetProperty(i interface{}, field string) interface{}
- func GetTypeOf(typeName string) reflect.Type
- func GetVideoDuration(path string) int
- func GetWindowsEnvironmentVariable(key string) (string, error)
- func InitializeArray(data []interface{}) (reflect.Value, error)
- func InitializeBaseTypeValue(t reflect.Type, value interface{}) reflect.Value
- func InitializeStructure(data map[string]interface{}, setEntity func(interface{})) (reflect.Value, error)
- func InitializeStructureFieldArrayValue(slice reflect.Value, fieldName string, fieldType reflect.Type, ...)
- func InitializeStructures(data []interface{}, typeName string, setEntity func(interface{})) (reflect.Value, error)
- func InsertBoolAt(pos int, val bool, arr *[]bool)
- func InsertInt64At(pos int, val int64, arr *[]int64)
- func InsertIntAt(pos int, val int, arr *[]int)
- func InsertStringAt(pos int, str string, arr *[]string)
- func IsBool(value interface{}) bool
- func IsCreditCardNumber(number string) bool
- func IsEmail(email string) bool
- func IsEmpty(name string) (bool, error)
- func IsLocal(hostname string) bool
- func IsNumeric(value interface{}) bool
- func IsPhoneNumber(number string) bool
- func IsStdBase64(str string) bool
- func IsUriBase64(str string) bool
- func IsUuid(uuidStr string) bool
- func IsValidEntityReferenceName(entityReferenceName string) bool
- func IsValidPackageName(packageName string) bool
- func IsValidVariableName(variableName string) bool
- func JsonErrorStr(functionName string, fileLine string, err error) string
- func KillProcessByName(name string) error
- func Less(val0 interface{}, val1 interface{}) bool
- func Log(infos ...interface{})
- func MakeInstance(typeName string, data map[string]interface{}, setEntity func(interface{})) reflect.Value
- func MakeTimestamp() int64
- func MatchISO8601_Date(str string) (*time.Time, error)
- func MatchISO8601_DateTime(str string) (*time.Time, error)
- func MatchISO8601_Time(str string) (*time.Time, error)
- func Move(source string, dest string) (err error)
- func MoveFile(source, destination string) (err error)
- func MyIP() string
- func MyIPv6() (string, error)
- func MyLocalIP(mac string) (string, error)
- func MyMacAddr(ip string) (string, error)
- func OpenBrowser(url string)
- func PidExists(pid int) (bool, error)
- func Ping(domain string) error
- func PrettyPrint(b []byte) ([]byte, error)
- func RandomUUID() string
- func ReadAudioMetadata(path string, thumnailHeight, thumbnailWidth int) (map[string]interface{}, error)
- func ReadDir(dirname string) ([]os.FileInfo, error)
- func ReadMetadata(path string) (map[string]interface{}, error)
- func ReadOutput(output chan string, rc io.ReadCloser)
- func RegisterFunction(name string, fct interface{})
- func RegisterType(typedNil interface{})
- func Remove(s []string, index int) ([]string, error)
- func RemoveAccent(text string) string
- func RemoveContents(dir string) error
- func RemoveDirContents(dir string) error
- func RemoveString(s []string, r string) []string
- func Round(x float64, n int) float64
- func RunCmd(name, dir string, args []string, wait chan error)
- func ScanIPs() ([]string, error)
- func SetEnvironmentVariable(key string, value string) error
- func SetMetadata(path, key, value string) error
- func SetProperty(i interface{}, field string, value interface{}) error
- func SetWindowsEnvironmentVariable(key string, value string) error
- func StringToBytes(s string) []byte
- func SvgToPng(input, output string, w, h int) error
- func TerminateProcess(pid int, exitcode int) error
- func ToBool(value interface{}) bool
- func ToBytes(val interface{}) ([]byte, error)
- func ToInt(value interface{}) int
- func ToJson(obj interface{}) (string, error)
- func ToMap(in interface{}) (map[string]interface{}, error)
- func ToNumeric(value interface{}) float64
- func ToString(value interface{}) string
- func UnsetEnvironmentVariable(key string) error
- func UnsetWindowsEnvironmentVariable(key string) error
- func WriteStringToFile(filepath, s string) error
- type Element
- type IPInfo
- type Referenceable
- type Stack
- type TypeManager
- type Version
Constants ¶
const ( /* A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase). */ UUID_PATTERN = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" VARIABLE_NAME_PATTERN = "^[a-zA-Z_$][a-zA-Z_$0-9]*$" PACKAGE_NAME_PATTERN = "^[a-zA-Z_$][a-zA-Z_$0-9]*(\\.[a-zA-Z_$][a-zA-Z_$0-9]*)+(\\.[a-zA-Z_$][a-zA-Z_$0-9]*)*$" ENTITY_NAME_PATTERN = "" /* 164-byte string literal not displayed */ ISO_8601_TIME_PATTERN = `` /* 143-byte string literal not displayed */ ISO_8601_DATE_PATTERN = `^(?P<year>-?(?:[1-9][0-9]*)?[0-9]{4})-(?P<month>1[0-2]|0[1-9])-(?P<day>3[01]|0[1-9]|[12][0-9])$` ISO_8601_DATE_TIME_PATTERN = `` /* 237-byte string literal not displayed */ URI_BASE_64_PATTERN = `(data:)(\\w+)(\\/)(\\w+)(;base64)` STD_BASE_64_PATTERN = `^(?:[A-Za-z0-9+/]{4})+(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$` )
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
func CallFunction ¶
func CallMethod ¶
func CallMethod(i interface{}, methodName string, params []interface{}) (interface{}, interface{})
*
- Make use of reflexion to call the method specified in the message.
func Copy ¶
Copy the src file to dst. Any existing file will be overwritten and will not copy file attributes.
func CopyDir ¶
*
- I made use of cp instead of go here...
- Be sure the command exist in the computer who run that command.
func CopySymLink ¶
func CreateDataChecksum ¶
func CreateDirIfNotExist ¶
func CreateFileChecksum ¶
func CreateSha1Key ¶
func DomainHasIp ¶
func ExtractTextFromJpeg ¶
ExtractTextFromJpeg extracts text from a JPEG image at the given path
func FunctionName ¶
func FunctionName() string
func GetChecksum ¶
func GetChecksum(values interface{}) string
*
- Recursive function that return the checksum value.
func GetEnvironmentVariable ¶
func GetExecName ¶
func GetHostnameIPMap ¶
func GetInstanceOf ¶
func GetInstanceOf(typeName string) interface{}
*
- Return a new instance of a given typename
func GetMD5Hash ¶
func GetProcessRunningStatus ¶
check if the process is actually running However, on Unix systems, os.FindProcess always succeeds and returns a Process for the given pid...regardless of whether the process exists or not.
func GetProperty ¶
func GetProperty(i interface{}, field string) interface{}
func GetVideoDuration ¶
func InitializeStructure ¶
func InitializeStructure(data map[string]interface{}, setEntity func(interface{})) (reflect.Value, error)
*
- Initialyse a single object from it value.
func InitializeStructureFieldArrayValue ¶
func InitializeStructureFieldArrayValue(slice reflect.Value, fieldName string, fieldType reflect.Type, values reflect.Value, setEntity func(interface{}))
Return an initialyse field value.
func InitializeStructures ¶
func InitializeStructures(data []interface{}, typeName string, setEntity func(interface{})) (reflect.Value, error)
*
- Initialyse an array of structures, return it as interface (array of the actual
- objects)
func InsertBoolAt ¶
func InsertInt64At ¶
func InsertIntAt ¶
func IsCreditCardNumber ¶
func IsPhoneNumber ¶
func IsUriBase64 ¶
func IsValidEntityReferenceName ¶
Determine if a string is a valid entity reference name
func IsValidPackageName ¶
Determine if a string is a valid package name
func IsValidVariableName ¶
Determine if a string is a valid variable name
func MakeInstance ¶
func MakeInstance(typeName string, data map[string]interface{}, setEntity func(interface{})) reflect.Value
*
- Create an instance of the type with it name.
func MakeTimestamp ¶
func MakeTimestamp() int64
func MatchISO8601_DateTime ¶
*
- Parse and return a time object from a 8601 iso string, the time zone is
- the UTC.
func MatchISO8601_Time ¶
*
- Parse and return a time object from a 8601 iso string, the time zone is
- the UTC.
func Move ¶
*
- I made use of mv instead of go here...
- Be sure the command exist in the computer who run that command.
func ReadAudioMetadata ¶
func ReadOutput ¶
func ReadOutput(output chan string, rc io.ReadCloser)
*
- Read output and send it to a channel.
func RegisterFunction ¶
func RegisterFunction(name string, fct interface{})
*
- Register a Go function to be able to call it dynamically latter.
func RemoveAccent ¶
func RemoveContents ¶
func RemoveDirContents ¶
func RemoveString ¶
func SetEnvironmentVariable ¶
func SetProperty ¶
func SetWindowsEnvironmentVariable ¶
Need a special function to get access to system variables.
func StringToBytes ¶
func ToMap ¶
ToMap converts a struct to a map using the struct's tags.
ToMap uses tags on struct fields to decide which fields to add to the returned map.
func WriteStringToFile ¶
Write a string to a given file.
Types ¶
type IPInfo ¶
type IPInfo struct { // IP holds the described IP address. IP string // Hostname holds a DNS name associated with the IP address. Hostname string // City holds the city of the ISP location. City string // Country holds the two-letter country code. Country string // Loc holds the latitude and longitude of the // ISP location as a comma-separated northing, easting // pair of floating point numbers. Loc string // Org describes the organization that is // responsible for the IP address. Org string // Postal holds the post code or zip code region of the ISP location. Postal string }
IPInfo describes a particular IP address.
type Referenceable ¶
type Referenceable interface {
GetUUID() string
}
*
- Use it to get UUID of referenceable object.
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
type TypeManager ¶
type TypeManager struct {
// contains filtered or unexported fields
}
type Version ¶
Base on https://go.dev/doc/modules/version-numbers for version number