fix: protocol v1
This commit is contained in:
@ -3,6 +3,7 @@ package v2
|
||||
import (
|
||||
"context"
|
||||
|
||||
"forge.cadoles.com/cadoles/go-emlid/reach/client/logger"
|
||||
"forge.cadoles.com/cadoles/go-emlid/reach/client/protocol"
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/pkg/errors"
|
||||
@ -13,6 +14,7 @@ const Identifier protocol.Identifier = "v2"
|
||||
const compatibleVersionConstraint = ">= 32"
|
||||
|
||||
type Protocol struct {
|
||||
logger logger.Logger
|
||||
}
|
||||
|
||||
// Available implements protocol.Protocol.
|
||||
@ -35,7 +37,7 @@ func (p *Protocol) Available(ctx context.Context, addr string) (bool, error) {
|
||||
}
|
||||
|
||||
if !versionConstraint.Check(version) {
|
||||
return false, errors.Errorf("reachview version '%s' does not match constraint '%s'", info.Reachview.Version, compatibleVersionConstraint)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
return true, nil
|
||||
@ -48,7 +50,7 @@ func (p *Protocol) Identifier() protocol.Identifier {
|
||||
|
||||
// Operations implements protocol.Protocol.
|
||||
func (p *Protocol) Operations(addr string) protocol.Operations {
|
||||
return &Operations{addr: addr}
|
||||
return &Operations{addr: addr, logger: p.logger}
|
||||
}
|
||||
|
||||
var _ protocol.Protocol = &Protocol{}
|
||||
|
Reference in New Issue
Block a user