feat: bootstrap reusable GoOmni framework

This commit is contained in:
2026-09-20 22:06:24 +08:00
commit 8b19aa79ee
60 changed files with 4923 additions and 0 deletions

16
middleware/request_id.go Normal file
View File

@@ -0,0 +1,16 @@
package middleware
import (
"crypto/rand"
"encoding/hex"
"fmt"
"time"
)
func newRequestID() string {
value := make([]byte, 16)
if _, err := rand.Read(value); err == nil {
return hex.EncodeToString(value)
}
return fmt.Sprintf("%d", time.Now().UnixNano())
}