Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LAA-Software-Engineering/golang-rest-api-template
/ types & classes
Types & classes
38 in github.com/LAA-Software-Engineering/golang-rest-api-template
⨍
Functions
337
◇
Types & classes
38
Struct
Book
pkg/models/book.go:5
Interface
BookHandler
BookHandler defines Gin handlers for book routes (HTTP layer only; persistence lives in pkg/repository).
pkg/api/books.go:27
Interface
BookPersistence
go:generate go run -mod=mod go.uber.org/mock/mockgen@v0.6.0 -destination=mock_persistence.go -package=repository golang-rest-api-template/pkg/reposito
pkg/repository/book.go:8
Struct
BookService
BookService coordinates book reads/writes, list caching, and cache generation bumps.
pkg/service/book_service.go:35
Interface
Cache
Cache abstracts Redis operations used by the app. Book list caching invalidates via a monotonic generation counter (see pkg/service BooksListCacheGenK
pkg/cache/cache.go:21
Struct
Claims
Claims carries custom JWT fields plus registered (standard) JWT claims.
pkg/auth/auth.go:45
Struct
CreateBook
pkg/models/book.go:14
Struct
ErrorBody
ErrorBody is the standard JSON error envelope for this API: {"error":"..."}.
pkg/httperr/httperr.go:6
Struct
GormBookStore
GormBookStore implements BookPersistence using GORM.
pkg/repository/book_gorm.go:12
Struct
GormUserStore
GormUserStore implements UserPersistence using GORM.
pkg/repository/user_gorm.go:14
Struct
HealthOKBody
HealthOKBody documents GET /api/v1/ 200 JSON (standard success envelope).
pkg/models/api_json.go:4
Struct
LoginAPIResponse
LoginAPIResponse documents POST /login 200 JSON.
pkg/models/api_json.go:9
Struct
LoginTokenBody
LoginTokenBody is the "data" object returned by POST /login on success.
pkg/models/user.go:11
Struct
LoginUser
pkg/models/user.go:5
Struct
MockBookPersistence
MockBookPersistence is a mock of BookPersistence interface.
pkg/repository/mock_persistence.go:20
Struct
MockBookPersistenceMockRecorder
MockBookPersistenceMockRecorder is the mock recorder for MockBookPersistence.
pkg/repository/mock_persistence.go:27
Struct
MockCache
MockCache is a mock of Cache interface.
pkg/cache/cache_mock.go:22
Struct
MockCacheMockRecorder
MockCacheMockRecorder is the mock recorder for MockCache.
pkg/cache/cache_mock.go:29
Struct
MockUserPersistence
MockUserPersistence is a mock of UserPersistence interface.
pkg/repository/mock_persistence.go:132
Struct
MockUserPersistenceMockRecorder
MockUserPersistenceMockRecorder is the mock recorder for MockUserPersistence.
pkg/repository/mock_persistence.go:139
Struct
PatchBook
PatchBook is the JSON body for PATCH /books/:id. Omitted JSON keys leave the field unchanged; the request must set at least one of title or author.
pkg/models/book.go:27
Struct
RegisterAPIResponse
RegisterAPIResponse documents POST /register 201 JSON.
pkg/models/api_json.go:14
Struct
RegisterSuccessBody
RegisterSuccessBody is the "data" object returned by POST /register on success.
pkg/models/user.go:16
Struct
ReplaceBook
ReplaceBook is the JSON body for PUT /books/:id (full replace of title and author).
pkg/models/book.go:20
Struct
User
pkg/models/user.go:20
Interface
UserHandler
UserHandler defines Gin handlers for auth routes (HTTP layer only).
pkg/api/user.go:17
Interface
UserPersistence
UserPersistence loads and stores users without HTTP or Gin.
pkg/repository/user.go:6
Struct
UserService
UserService handles authentication use-cases without Gin.
pkg/service/user_service.go:26
Struct
bookHandler
pkg/api/books.go:37
Struct
envelope
pkg/httpresp/httpresp.go:9
Struct
errTestStatus
pkg/api/book_routes_auth_test.go:224
Struct
fakeBookStore
pkg/service/book_service_test.go:20
Struct
fakeUserStore
pkg/service/user_service_test.go:19
Struct
item
pkg/httpresp/httpresp_test.go:30
Struct
mongoAccessLogQueue
mongoAccessLogQueue buffers access-log documents and inserts them from a single worker so HTTP handlers do not block on MongoDB. If the buffer fills,
pkg/middleware/logger.go:23
Interface
redisPinger
redisPinger matches *redis.Client without importing the concrete type in Cache.
pkg/api/probes.go:64
Struct
requestIDContextKey
pkg/middleware/request_id.go:16
Struct
userHandler
pkg/api/user.go:22