aboutsummaryrefslogtreecommitdiff
path: root/internal/api/types.go
AgeCommit message (Collapse)Author
5 daysinternal/api: refactor error handling to increase consistencyEthan Lee
- Refactored error handling to avoid leaking internal implementation details. Database and system errors are masked by falling back to standard HTTP statuses but still logging the entire error context. - User facing error messages can now be specified within the Error struct. - Added helpers in types.go to simplify error construction. - Updated ServeModuleVersions to explicitly return 404 when no versions are found. - Expanded test coverage in api_test.go to include 404 and 400 edge cases. Change-Id: I89c4be3941126c15df6aefdd21e4bbd2d3b23be1 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764820 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
8 daysinternal/api: add support for readme and licenses in ServeModuleEthan Lee
- Utilize conditional fieldset in GetUnit to efficiently retrieve readme and license fields. - Modify Module type to include HasGoMod. Change-Id: Id22ac3f2485392749742332701d2e913f047b3da Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763401 kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
13 daysinternal/api: consolidate error response handling for all handlersEthan Lee
- Ensure that all errors are wrapped correctly and served as a json error response. Change-Id: I588552c755fb2135916da95dec6d37238d030d39 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/758821 Auto-Submit: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-18internal/api: tweaksJonathan Amsterdam
- Minor doc changes. - Slight code reorg. - Use new reflect.Pointer over reflect.Ptr. Change-Id: If1a6bb1d335f32a119cc8b4487e3eacbcd6b6431 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/756420 Reviewed-by: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-11internal/api: add error typeEthan Lee
- This new error type should also capture alternative candidates given an ambiguous package path. Change-Id: I748cecdcc9d7656d4ea4d148dff090e230676f08 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754500 Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2026-03-06internal/api: define new API typesEthan Lee
- Defined comprehensive types to represent return structures for upcoming REST API. Change-Id: Ie46aef2a4677daec9e5bb18c2ecd08cee8cb3c32 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/749120 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com>