huge refactor
This commit is contained in:
parent
8d6c2b6687
commit
38829c0179
23 changed files with 544 additions and 141 deletions
115
proto/surugayaScrapper/scrapper_grpc.pb.go
Normal file
115
proto/surugayaScrapper/scrapper_grpc.pb.go
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.32.0
|
||||
// source: scrapper.proto
|
||||
|
||||
package surugayaScrapper
|
||||
|
||||
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 (
|
||||
SurugayaScrapper_ProcessTasks_FullMethodName = "/surugayaScrapper.SurugayaScrapper/ProcessTasks"
|
||||
)
|
||||
|
||||
// SurugayaScrapperClient is the client API for SurugayaScrapper 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.
|
||||
type SurugayaScrapperClient interface {
|
||||
ProcessTasks(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Task, Result], error)
|
||||
}
|
||||
|
||||
type surugayaScrapperClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSurugayaScrapperClient(cc grpc.ClientConnInterface) SurugayaScrapperClient {
|
||||
return &surugayaScrapperClient{cc}
|
||||
}
|
||||
|
||||
func (c *surugayaScrapperClient) ProcessTasks(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Task, Result], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &SurugayaScrapper_ServiceDesc.Streams[0], SurugayaScrapper_ProcessTasks_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[Task, Result]{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 SurugayaScrapper_ProcessTasksClient = grpc.BidiStreamingClient[Task, Result]
|
||||
|
||||
// SurugayaScrapperServer is the server API for SurugayaScrapper service.
|
||||
// All implementations must embed UnimplementedSurugayaScrapperServer
|
||||
// for forward compatibility.
|
||||
type SurugayaScrapperServer interface {
|
||||
ProcessTasks(grpc.BidiStreamingServer[Task, Result]) error
|
||||
mustEmbedUnimplementedSurugayaScrapperServer()
|
||||
}
|
||||
|
||||
// UnimplementedSurugayaScrapperServer 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 UnimplementedSurugayaScrapperServer struct{}
|
||||
|
||||
func (UnimplementedSurugayaScrapperServer) ProcessTasks(grpc.BidiStreamingServer[Task, Result]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method ProcessTasks not implemented")
|
||||
}
|
||||
func (UnimplementedSurugayaScrapperServer) mustEmbedUnimplementedSurugayaScrapperServer() {}
|
||||
func (UnimplementedSurugayaScrapperServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeSurugayaScrapperServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SurugayaScrapperServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSurugayaScrapperServer interface {
|
||||
mustEmbedUnimplementedSurugayaScrapperServer()
|
||||
}
|
||||
|
||||
func RegisterSurugayaScrapperServer(s grpc.ServiceRegistrar, srv SurugayaScrapperServer) {
|
||||
// If the following call pancis, it indicates UnimplementedSurugayaScrapperServer 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(&SurugayaScrapper_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SurugayaScrapper_ProcessTasks_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
return srv.(SurugayaScrapperServer).ProcessTasks(&grpc.GenericServerStream[Task, Result]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type SurugayaScrapper_ProcessTasksServer = grpc.BidiStreamingServer[Task, Result]
|
||||
|
||||
// SurugayaScrapper_ServiceDesc is the grpc.ServiceDesc for SurugayaScrapper service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SurugayaScrapper_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "surugayaScrapper.SurugayaScrapper",
|
||||
HandlerType: (*SurugayaScrapperServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "ProcessTasks",
|
||||
Handler: _SurugayaScrapper_ProcessTasks_Handler,
|
||||
ServerStreams: true,
|
||||
ClientStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "scrapper.proto",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue