-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelpers.go
48 lines (39 loc) · 850 Bytes
/
helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"crypto/rand"
"fmt"
"log"
// "math/rand"
"time"
)
func pseudo_uuid() (uuid string) {
b := make([]byte, 16)
_, err := rand.Read(b)
if err != nil {
fmt.Println("Error: ", err)
return
}
uuid = fmt.Sprintf("%X-%X-%X-%X-%X", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
return
}
func randSeq(n int) string {
// _ := n
// b := make([]rune, n)
// for i := range b {
// b[i] = letters[rand.Intn(len(letters))]
// }
return pseudo_uuid() //string(b)
}
func timeTrack(start time.Time, name string) {
elapsed := time.Since(start)
if elapsed == elapsed {
}
log.Printf("%s took %s", name, elapsed)
}
// audit no new
func AuditProcess(ltid []byte, laids []byte) *TaskAudit {
task := GetTaskMap(string(ltid))
activityLog := GetActivityLog(string(laids))
audit, _ := RunAudit(task, activityLog)
return audit
}