Skip to content

feat: add ConnTimeout option, improve GenId entropy and refine logging - #18

Merged
luopengift merged 1 commit into
mainfrom
dev
Jun 24, 2026
Merged

feat: add ConnTimeout option, improve GenId entropy and refine logging#18
luopengift merged 1 commit into
mainfrom
dev

Conversation

@luopengift

Copy link
Copy Markdown
Contributor

options.go / transport.go:

  • Add field (default 10s) to Options for configuring TCP dial timeout independently from the overall request
  • Pass to socket dialer instead of hard-coded value
  • Add doc note warning that unix:// path is session-level only

stat.go / trace.go / response.go / request.go:

  • Refactor Stat struct fields and Print/String output format
  • Add response body truncation in LogS (cap at 1024 chars) and drop redundant json.Marshal path; use a2s helper uniformly

uid.go:

  • Switch GenId from nanosecond to microsecond precision multiplied by 1000 to cleanly separate time bits from random bits, reducing collision risk under high concurrency while staying within uint64

util.go:

  • Remove unused encoding/json import
  • Simplify LogS body logging via a2s helper with 1024-byte truncation

requests_test.go / request_test.go / response_test.go / stat_test.go:

  • Update and extend tests to cover new fields, LogS truncation, GenId uniqueness, and revised Stat output format

options.go / transport.go:
- Add  field (default 10s) to Options for configuring TCP
  dial timeout independently from the overall request
- Pass  to socket dialer instead of hard-coded value
- Add doc note warning that unix:// path is session-level only

stat.go / trace.go / response.go / request.go:
- Refactor Stat struct fields and Print/String output format
- Add response body truncation in LogS (cap at 1024 chars) and drop
  redundant json.Marshal path; use a2s helper uniformly

uid.go:
- Switch GenId from nanosecond to microsecond precision multiplied by
  1000 to cleanly separate time bits from random bits, reducing
  collision risk under high concurrency while staying within uint64

util.go:
- Remove unused encoding/json import
- Simplify LogS body logging via a2s helper with 1024-byte truncation

requests_test.go / request_test.go / response_test.go / stat_test.go:
- Update and extend tests to cover new fields, LogS truncation,
  GenId uniqueness, and revised Stat output format
@luopengift
luopengift merged commit 9815770 into main Jun 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant