feat(protocol): allow override of dial func
This commit is contained in:
@ -15,6 +15,7 @@ const compatibleVersionConstraint = ">= 32"
|
||||
|
||||
type Protocol struct {
|
||||
logger logger.Logger
|
||||
dial protocol.DialFunc
|
||||
}
|
||||
|
||||
// Available implements protocol.Protocol.
|
||||
@ -50,7 +51,11 @@ func (p *Protocol) Identifier() protocol.Identifier {
|
||||
|
||||
// Operations implements protocol.Protocol.
|
||||
func (p *Protocol) Operations(addr string) protocol.Operations {
|
||||
return &Operations{addr: addr, logger: p.logger}
|
||||
return &Operations{
|
||||
dial: p.dial,
|
||||
addr: addr,
|
||||
logger: p.logger,
|
||||
}
|
||||
}
|
||||
|
||||
var _ protocol.Protocol = &Protocol{}
|
||||
|
Reference in New Issue
Block a user