mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-25 18:04:58 +01:00
c69ebd3806
cmd subdir does not build on purpose, it's only left in tree to grab old code and move it to github.com/zrepl/zrepl/daemon
21 lines
518 B
Go
21 lines
518 B
Go
package connecter
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/problame/go-streamrpc"
|
|
"github.com/zrepl/zrepl/config"
|
|
)
|
|
|
|
func FromConfig(g config.Global, in config.ConnectEnum) (streamrpc.Connecter, error) {
|
|
switch v := in.Ret.(type) {
|
|
case *config.SSHStdinserverConnect:
|
|
return SSHStdinserverConnecterFromConfig(v)
|
|
case *config.TCPConnect:
|
|
return TCPConnecterFromConfig(v)
|
|
case *config.TLSConnect:
|
|
return TLSConnecterFromConfig(v)
|
|
default:
|
|
panic(fmt.Sprintf("implementation error: unknown connecter type %T", v))
|
|
}
|
|
}
|