()
| 17 | ) |
| 18 | |
| 19 | func GenLoggingSessionId() (string, error) { |
| 20 | bytes := make([]byte, 16) |
| 21 | if _, err := rand.Read(bytes); err != nil { |
| 22 | return "", err |
| 23 | } |
| 24 | id := make([]byte, hex.EncodedLen(len(bytes))) |
| 25 | hex.Encode(id, bytes) |
| 26 | return string(id), nil |
| 27 | } |
| 28 | |
| 29 | type LogSession struct { |
| 30 | Id string |