28 lines
860 B
Go
28 lines
860 B
Go
// Package roomclient adapts room-service protobuf clients for user-service moderation use cases.
|
|
package roomclient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"google.golang.org/grpc"
|
|
roomv1 "hyapp.local/api/proto/room/v1"
|
|
)
|
|
|
|
// Client exposes only the room command needed by user-service platform moderation.
|
|
type Client interface {
|
|
SystemEvictUser(ctx context.Context, req *roomv1.SystemEvictUserRequest) (*roomv1.SystemEvictUserResponse, error)
|
|
}
|
|
|
|
type grpcClient struct {
|
|
client roomv1.RoomCommandServiceClient
|
|
}
|
|
|
|
// NewGRPC returns a minimal room-service client.
|
|
func NewGRPC(conn grpc.ClientConnInterface) Client {
|
|
return &grpcClient{client: roomv1.NewRoomCommandServiceClient(conn)}
|
|
}
|
|
|
|
func (c *grpcClient) SystemEvictUser(ctx context.Context, req *roomv1.SystemEvictUserRequest) (*roomv1.SystemEvictUserResponse, error) {
|
|
return c.client.SystemEvictUser(ctx, req)
|
|
}
|