Init commit

This commit is contained in:
世界
2022-06-30 21:27:56 +08:00
commit cfa35e5a92
39 changed files with 2202 additions and 0 deletions

15
log/id.go Normal file
View File

@@ -0,0 +1,15 @@
package log
import (
"context"
"math/rand"
)
type idContext struct {
context.Context
id uint32
}
func ContextWithID(ctx context.Context) context.Context {
return &idContext{ctx, rand.Uint32()}
}