Add new functionality for managing and synchronizing academic grades and exam schedules. This includes new models, repositories, services, and HTTP handlers, along with updated gRPC definitions and dependency injection configuration. Additionally, improve the reliability of unread message count tracking by implementing an atomic Lua script for Redis operations in the conversation cache.
126 lines
4.9 KiB
Go
126 lines
4.9 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc v7.34.1
|
|
// source: proto/runner/runner.proto
|
|
|
|
package runner
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
RunnerHub_Connect_FullMethodName = "/runner.RunnerHub/Connect"
|
|
)
|
|
|
|
// RunnerHubClient is the client API for RunnerHub service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
//
|
|
// RunnerHub 服务 - 由 Backend 服务器实现
|
|
// Runner 作为客户端主动连接,建立双向流通信
|
|
type RunnerHubClient interface {
|
|
// Connect 建立双向流连接
|
|
// Runner 通过此连接注册、接收任务、返回结果
|
|
Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StreamMessage, StreamMessage], error)
|
|
}
|
|
|
|
type runnerHubClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewRunnerHubClient(cc grpc.ClientConnInterface) RunnerHubClient {
|
|
return &runnerHubClient{cc}
|
|
}
|
|
|
|
func (c *runnerHubClient) Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StreamMessage, StreamMessage], error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
stream, err := c.cc.NewStream(ctx, &RunnerHub_ServiceDesc.Streams[0], RunnerHub_Connect_FullMethodName, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &grpc.GenericClientStream[StreamMessage, StreamMessage]{ClientStream: stream}
|
|
return x, nil
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RunnerHub_ConnectClient = grpc.BidiStreamingClient[StreamMessage, StreamMessage]
|
|
|
|
// RunnerHubServer is the server API for RunnerHub service.
|
|
// All implementations must embed UnimplementedRunnerHubServer
|
|
// for forward compatibility.
|
|
//
|
|
// RunnerHub 服务 - 由 Backend 服务器实现
|
|
// Runner 作为客户端主动连接,建立双向流通信
|
|
type RunnerHubServer interface {
|
|
// Connect 建立双向流连接
|
|
// Runner 通过此连接注册、接收任务、返回结果
|
|
Connect(grpc.BidiStreamingServer[StreamMessage, StreamMessage]) error
|
|
mustEmbedUnimplementedRunnerHubServer()
|
|
}
|
|
|
|
// UnimplementedRunnerHubServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedRunnerHubServer struct{}
|
|
|
|
func (UnimplementedRunnerHubServer) Connect(grpc.BidiStreamingServer[StreamMessage, StreamMessage]) error {
|
|
return status.Error(codes.Unimplemented, "method Connect not implemented")
|
|
}
|
|
func (UnimplementedRunnerHubServer) mustEmbedUnimplementedRunnerHubServer() {}
|
|
func (UnimplementedRunnerHubServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeRunnerHubServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to RunnerHubServer will
|
|
// result in compilation errors.
|
|
type UnsafeRunnerHubServer interface {
|
|
mustEmbedUnimplementedRunnerHubServer()
|
|
}
|
|
|
|
func RegisterRunnerHubServer(s grpc.ServiceRegistrar, srv RunnerHubServer) {
|
|
// If the following call panics, it indicates UnimplementedRunnerHubServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&RunnerHub_ServiceDesc, srv)
|
|
}
|
|
|
|
func _RunnerHub_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
return srv.(RunnerHubServer).Connect(&grpc.GenericServerStream[StreamMessage, StreamMessage]{ServerStream: stream})
|
|
}
|
|
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
|
type RunnerHub_ConnectServer = grpc.BidiStreamingServer[StreamMessage, StreamMessage]
|
|
|
|
// RunnerHub_ServiceDesc is the grpc.ServiceDesc for RunnerHub service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var RunnerHub_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "runner.RunnerHub",
|
|
HandlerType: (*RunnerHubServer)(nil),
|
|
Methods: []grpc.MethodDesc{},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Connect",
|
|
Handler: _RunnerHub_Connect_Handler,
|
|
ServerStreams: true,
|
|
ClientStreams: true,
|
|
},
|
|
},
|
|
Metadata: "proto/runner/runner.proto",
|
|
}
|