basic app
This commit is contained in:
parent
0a6e246a5c
commit
8d6c2b6687
30 changed files with 1469 additions and 0 deletions
27
internal/app/server.go
Normal file
27
internal/app/server.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"google.golang.org/grpc"
|
||||
"parsing-service/internal/appState"
|
||||
pb "parsing-service/proto/taskProcessor"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
pb.UnimplementedTaskProcessorServer
|
||||
state *appState.State
|
||||
}
|
||||
|
||||
func newServer(app *App) *grpc.Server {
|
||||
s := grpc.NewServer()
|
||||
srv := &Server{
|
||||
state: app.State,
|
||||
}
|
||||
pb.RegisterTaskProcessorServer(s, srv)
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *Server) ProcessorStatus(_ context.Context, _ *pb.ProcessorStatusRequest) (*pb.ProcessorStatusResponse, error) {
|
||||
resp := s.state.StateResponse()
|
||||
return resp, nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue