I need to connect to remote mongoDB server via ssh, i was doing this earlier with mysql and its looks like :
sshcon, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", sshHost, sshPort), sshConfig)
if err == nil {
defer sshcon.Close()
mysql.RegisterDial("mysql+tcp", (&ViaSSHDialer{sshcon}).Dial)
Is there a similar function like mysql.RegisterDial in mgo package?