mirror of
https://github.com/Walter-Sparrow/lunar-tear.git
synced 2026-07-02 05:43:41 +03:00
16 lines
337 B
Go
16 lines
337 B
Go
package interceptor
|
|
|
|
import (
|
|
"context"
|
|
|
|
"lunar-tear/server/internal/model"
|
|
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
func Platform(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) {
|
|
p := model.ClientPlatformFromHeaders(ctx)
|
|
ctx = model.NewContextWithPlatform(ctx, p)
|
|
return handler(ctx, req)
|
|
}
|