some funcs stubbed out, Dbus methods in consts.

This commit is contained in:
2021-12-15 03:48:40 -05:00
parent 6591aec7a8
commit ebe91c867c
9 changed files with 409 additions and 8 deletions

50
walletmanager_funcs.go Normal file
View File

@@ -0,0 +1,50 @@
package gokwallet
import (
"github.com/godbus/dbus/v5"
)
/*
NewWalletManager returns a WalletManager.
If appId is empty/nil, DefaultAppID will be used as the app ID.
If appId is specified, only the first string is used.
*/
func NewWalletManager(appID ...string) (wm *WalletManager, err error) {
var realAppID string
if appID != nil && len(appID) > 0 {
realAppID = appID[0]
} else {
realAppID = DefaultAppID
}
wm = &WalletManager{
DbusObject: &DbusObject{
Conn: nil,
Dbus: nil,
},
AppID: realAppID,
Wallets: make(map[string]*Wallet),
}
if wm.DbusObject.Conn, err = dbus.SessionBus(); err != nil {
return
}
wm.DbusObject.Dbus = wm.DbusObject.Conn.Object(DbusService, dbus.ObjectPath(DbusPath))
return
}
/*
Update fetches/updates all Wallet objects in a WalletManager.
*/
func (wm *WalletManager) Update() (err error) {
var wallets []*Wallet
// TODO.
_ = wallets
return
}