Documentation ¶
Index ¶
- Variables
- func GenId(id ...string) string
- func GenId2() string
- func GetLocIp() (net.IP, error)
- func GetRequestId(ctx context.Context) string
- func GetSpanId(ctx context.Context) string
- func GroupList(max, batch int) <-chan [2]int
- func HumanDuration(t time.Duration) string
- func ParseId(id string) int64
- func WithRequestId(ctx context.Context, requestId string) context.Context
- func WithSpanId(ctx context.Context, spanId string) context.Context
Constants ¶
This section is empty.
Variables ¶
View Source
var IP string
IP 本地IP地址
Functions ¶
func GroupList ¶
GroupList 将长度为max的数据切分开来,每部分batch个,最后不够batch有多少算多少 var tt = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} ch := GroupList(len(tt), 3)
for k := range ch { fmt.Println(k, tt[k[0]:k[1]]) }
func WithRequestId ¶
WithRequestId append taskId to context
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.