Migrate to remotes interface

This commit is contained in:
2024-01-16 12:48:42 -05:00
parent 5337ea544b
commit e7f8b86f72
13 changed files with 160 additions and 283 deletions

View File

@ -13,22 +13,22 @@ import (
const defNetDialTimeoutSecs = 5
type GitlabProto int
type GitProto int
const (
GitlabProtoSSH GitlabProto = iota
GitlabProtoHTTP
GitProtoSSH GitProto = iota
GitProtoHTTP
)
var (
ErrUnknownHost error = errors.New("No addresses found for host")
)
func (p *Project) CheckHost(proto GitlabProto) error {
func (p *Project) CheckHost(proto GitProto) error {
switch proto {
case GitlabProtoHTTP:
case GitProtoHTTP:
return p.checkHTTPRemote()
case GitlabProtoSSH:
case GitProtoSSH:
return p.checkSSHRemote()
}
return errors.New("Unknown git protocol")