13 Commits

Author SHA1 Message Date
Lei Xue
93e1476a0f feat: implement cmd management for targets, LUNs, and TPGTs (fixes #36)
- Fix target delete URL path mismatch (/targets/ -> /target/)
- Implement target create/delete server handlers with proper validation
- Add DeleteTarget method with force flag and mutex locking to SCSITargetService
- Implement full LU management: create/list/delete through CLI, client, and server
- Add TPGT list command to show target portal group tags
- Add unit tests for target/LU router handlers and SCSI service

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 20:30:47 +08:00
Lei Xue
633b84009c fix versionMatcher: use non-capturing group (?:-dirty)? for gorilla/mux
gorilla/mux explicitly rejects capturing groups () in route regexps,
only non-capturing groups (?:) are allowed. The original regex was
missing the ? to make -dirty optional.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 18:51:01 +08:00
Lei Xue
549f0cb460 fix gofmt import ordering
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 18:30:49 +08:00
Lei Xue
f1cec4f5d4 fix regex, remove unsafe pointer usage, and add graceful HTTP shutdown
- Fix versionMatcher regex: gorilla/mux does not support (?:) syntax,
  and -dirty suffix was required instead of optional
- Replace unsafe.Pointer LUN casts with binary.LittleEndian.Uint64
  in sbc.go, scsi.go, and target.go
- Implement graceful HTTP server shutdown with 5s timeout using
  srv.Shutdown() instead of raw listener close
- Replace golang.org/x/net/context with standard library context
- Respect existing req.Cancel value in canceler to avoid overwriting
- Add early context cancellation check in Do() to fail fast

Based on review of PR #120 by @orzhang, with fixes applied.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 18:27:56 +08:00
Lei Xue
00cfac3d24 optimize the perf and support more features 2026-03-14 11:45:35 +08:00
Wenhua Shi
a6cf150e95 fix some issues 2023-04-17 19:29:01 +08:00
chessman
8d17243b3a update dependencies 2019-06-12 19:10:59 +03:00
Lei Xue
d3c3a96920 delete cit to use new gotgt as main cmd, use logrus instead of glog 2016-11-29 11:21:40 +08:00
Lei Xue
bd7193880e basic change for godoc 2016-11-27 13:31:43 +08:00
Lei Xue
8b135f1125 add more libiscsi test cases 2016-10-06 20:01:35 +08:00
Lei Xue
efa61651e7 update deps 2016-09-12 12:32:14 +08:00
Lei Xue
f97ab027de add basic command framework and apiserver 2016-08-27 20:07:03 +08:00
Lei Xue
a9a7d63c20 init commit 2015-12-14 10:23:35 +08:00