MCPcopy Index your code
hub / github.com/PasarGuard/node / GetLogs

Method GetLogs

controller/rpc/log.go:10–29  ·  view source on GitHub ↗
(_ *common.Empty, stream common.NodeService_GetLogsServer)

Source from the content-addressed store, hash-verified

8)
9
10func (s *Service) GetLogs(_ *common.Empty, stream common.NodeService_GetLogsServer) error {
11 logChan := s.Backend().Logs()
12
13 for {
14 select {
15 case log, ok := <-logChan:
16 if !ok {
17 return errors.New("log channel closed")
18 }
19
20 if err := stream.Send(&common.Log{Detail: log}); err != nil {
21 return fmt.Errorf("failed to send log: %w", err)
22 }
23
24 case <-stream.Context().Done():
25 // Client has disconnected or cancelled the request
26 return nil
27 }
28 }
29}

Callers

nothing calls this directly

Implementers 1

Controllercontroller/controller.go

Calls 2

BackendMethod · 0.80
LogsMethod · 0.65

Tested by

no test coverage detected