feat: wire RDP service into Wails app
Register RDPService on WraithApp with a mock backend factory and expose it as a Wails service in main.go so the frontend can call RDP methods via bindings. The factory will be swapped to a FreeRDP purego backend when running on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
949ed6e672
commit
c00e2a446f
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/vstockwell/wraith/internal/credentials"
|
"github.com/vstockwell/wraith/internal/credentials"
|
||||||
"github.com/vstockwell/wraith/internal/db"
|
"github.com/vstockwell/wraith/internal/db"
|
||||||
"github.com/vstockwell/wraith/internal/plugin"
|
"github.com/vstockwell/wraith/internal/plugin"
|
||||||
|
"github.com/vstockwell/wraith/internal/rdp"
|
||||||
"github.com/vstockwell/wraith/internal/session"
|
"github.com/vstockwell/wraith/internal/session"
|
||||||
"github.com/vstockwell/wraith/internal/settings"
|
"github.com/vstockwell/wraith/internal/settings"
|
||||||
"github.com/vstockwell/wraith/internal/sftp"
|
"github.com/vstockwell/wraith/internal/sftp"
|
||||||
@ -32,6 +33,7 @@ type WraithApp struct {
|
|||||||
Plugins *plugin.Registry
|
Plugins *plugin.Registry
|
||||||
SSH *ssh.SSHService
|
SSH *ssh.SSHService
|
||||||
SFTP *sftp.SFTPService
|
SFTP *sftp.SFTPService
|
||||||
|
RDP *rdp.RDPService
|
||||||
Credentials *credentials.CredentialService
|
Credentials *credentials.CredentialService
|
||||||
unlocked bool
|
unlocked bool
|
||||||
}
|
}
|
||||||
@ -66,6 +68,12 @@ func New() (*WraithApp, error) {
|
|||||||
})
|
})
|
||||||
sftpSvc := sftp.NewSFTPService()
|
sftpSvc := sftp.NewSFTPService()
|
||||||
|
|
||||||
|
// RDP service with mock backend factory for development.
|
||||||
|
// In production on Windows, the factory will return a FreeRDP-backed implementation.
|
||||||
|
rdpSvc := rdp.NewRDPService(func() rdp.RDPBackend {
|
||||||
|
return rdp.NewMockBackend()
|
||||||
|
})
|
||||||
|
|
||||||
// CredentialService requires the vault to be unlocked, so it starts nil.
|
// CredentialService requires the vault to be unlocked, so it starts nil.
|
||||||
// It is created lazily after the vault is unlocked via initCredentials().
|
// It is created lazily after the vault is unlocked via initCredentials().
|
||||||
|
|
||||||
@ -83,6 +91,7 @@ func New() (*WraithApp, error) {
|
|||||||
Plugins: pluginReg,
|
Plugins: pluginReg,
|
||||||
SSH: sshSvc,
|
SSH: sshSvc,
|
||||||
SFTP: sftpSvc,
|
SFTP: sftpSvc,
|
||||||
|
RDP: rdpSvc,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
1
main.go
1
main.go
@ -33,6 +33,7 @@ func main() {
|
|||||||
application.NewService(wraith.Settings),
|
application.NewService(wraith.Settings),
|
||||||
application.NewService(wraith.SSH),
|
application.NewService(wraith.SSH),
|
||||||
application.NewService(wraith.SFTP),
|
application.NewService(wraith.SFTP),
|
||||||
|
application.NewService(wraith.RDP),
|
||||||
},
|
},
|
||||||
Assets: application.AssetOptions{
|
Assets: application.AssetOptions{
|
||||||
Handler: application.BundledAssetFileServer(assets),
|
Handler: application.BundledAssetFileServer(assets),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user