mirror of https://github.com/usememos/memos.git
fix: resolve golangci-lint errors
- Add periods to end of multi-line comments (godot) - Omit unused receiver names in methods (revive)
This commit is contained in:
parent
06a16fef43
commit
c32a79b73b
|
|
@ -49,7 +49,7 @@ func NewGRPCAuthInterceptor(store *store.Store, secret string) *GRPCAuthIntercep
|
|||
// On successful authentication, context values are set:
|
||||
// - auth.UserIDContextKey: The authenticated user's ID
|
||||
// - auth.SessionIDContextKey: Session ID (cookie auth only)
|
||||
// - auth.AccessTokenContextKey: JWT token (bearer auth only)
|
||||
// - auth.AccessTokenContextKey: JWT token (bearer auth only).
|
||||
func (in *GRPCAuthInterceptor) AuthenticationInterceptor(ctx context.Context, request any, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import (
|
|||
// This wrapper pattern allows us to:
|
||||
// - Reuse existing gRPC service implementations
|
||||
// - Support both native gRPC and Connect protocols
|
||||
// - Maintain a single source of truth for business logic
|
||||
// - Maintain a single source of truth for business logic.
|
||||
type ConnectServiceHandler struct {
|
||||
*APIV1Service
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,11 +35,11 @@ func (in *LoggingInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFun
|
|||
}
|
||||
}
|
||||
|
||||
func (in *LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||
func (*LoggingInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||
return next // No-op for server-side interceptor
|
||||
}
|
||||
|
||||
func (in *LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||
func (*LoggingInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||
return next // Streaming not used in this service
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ func (in *LoggingInterceptor) log(procedure string, err error) {
|
|||
slog.LogAttrs(context.Background(), level, msg, attrs...)
|
||||
}
|
||||
|
||||
func (in *LoggingInterceptor) classifyError(err error) (slog.Level, string) {
|
||||
func (*LoggingInterceptor) classifyError(err error) (slog.Level, string) {
|
||||
if err == nil {
|
||||
return slog.LevelInfo, "OK"
|
||||
}
|
||||
|
|
@ -106,11 +106,11 @@ func (in *RecoveryInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFu
|
|||
}
|
||||
}
|
||||
|
||||
func (in *RecoveryInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||
func (*RecoveryInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||
return next
|
||||
}
|
||||
|
||||
func (in *RecoveryInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||
func (*RecoveryInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||
return next
|
||||
}
|
||||
|
||||
|
|
@ -180,11 +180,11 @@ func (in *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc {
|
|||
}
|
||||
}
|
||||
|
||||
func (in *AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||
func (*AuthInterceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc {
|
||||
return next
|
||||
}
|
||||
|
||||
func (in *AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||
func (*AuthInterceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {
|
||||
return next
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue