mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-10 10:47:51 +08:00
feat(net:service) add SetHandler method
Allows the service to be used through an interface. NB: If the handler is exposed directly, clients of the service cannot swap out their concrete references and replace them with interfaces
This commit is contained in:
parent
6fa0e2157f
commit
503b1aa79e
@ -204,3 +204,7 @@ func (s *Service) handleIncomingMessage(ctx context.Context, m msg.NetMessage) {
|
||||
case <-ctx.Done():
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Service) SetHandler(h Handler) {
|
||||
s.Handler = h
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user