Versions in this module Expand all Collapse all v1 v1.0.2 Jan 26, 2026 v1.0.1 Jan 26, 2026 v1.0.0 Jan 26, 2026 Changes in this version + const DomainIDKey + const EmailKey + const RoleKey + const UserIDKey + func Auth(jwtSecret string, apiKeyRepo repository.APIKeyRepository, logger *zap.Logger) func(http.Handler) http.Handler + func GenerateJWT(userID int64, email, role string, domainID *int64, secret string) (string, error) + func GetDomainID(r *http.Request) (int64, bool) + func GetEmail(r *http.Request) (string, bool) + func GetRole(r *http.Request) (string, bool) + func GetUserID(r *http.Request) (int64, bool) + func Logger(logger *zap.Logger) func(http.Handler) http.Handler + func RateLimit(repo repository.RateLimitRepository, logger *zap.Logger) func(http.Handler) http.Handler + func RespondCreated(w http.ResponseWriter, data interface{}, message string) + func RespondError(w http.ResponseWriter, status int, message string) + func RespondJSON(w http.ResponseWriter, status int, payload interface{}) + func RespondNoContent(w http.ResponseWriter) + func RespondPaginated(w http.ResponseWriter, data interface{}, page, pageSize, totalItems int) + func RespondSuccess(w http.ResponseWriter, data interface{}, message string) + type Claims struct + DomainID *int64 + Email string + Role string + UserID int64 + func ValidateJWT(tokenString, secret string) (*Claims, error) + type ErrorResponse struct + Code int + Error string + Message string + type LoggingMiddleware struct + func NewLoggingMiddleware(logger *zap.Logger) *LoggingMiddleware + func (m *LoggingMiddleware) Wrap(next http.Handler) http.Handler + type PaginatedResponse struct + Data interface{} + Page int + PageSize int + TotalItems int + TotalPages int + type SuccessResponse struct + Data interface{} + Message string