recursion flags set up
This commit is contained in:
parent
ebe91c867c
commit
8d81c5f0cc
89
consts.go
89
consts.go
@ -163,3 +163,92 @@ const (
|
||||
// DbusPath is the path for DbusService.
|
||||
DbusPath string = "/modules/kwalletd5"
|
||||
)
|
||||
|
||||
// Recursion options.
|
||||
|
||||
/*
|
||||
RecurseNone specifies that no recursion should be done.
|
||||
If present, it takes precedent over all over RecurseOptsFlags present.
|
||||
|
||||
Performed in/from:
|
||||
WalletManager
|
||||
Wallet
|
||||
Folder
|
||||
(WalletItem)
|
||||
*/
|
||||
const RecurseNone RecurseOptsFlag = 0
|
||||
const (
|
||||
/*
|
||||
RecurseWallet indicates that Wallet objects should have Wallet.Update called.
|
||||
|
||||
Performed in/from: WalletManager
|
||||
*/
|
||||
RecurseWallet RecurseOptsFlag = 1 << iota
|
||||
/*
|
||||
RecurseFolder indicates that Folder objects should have Folder.Update called.
|
||||
|
||||
Performed in/from:
|
||||
Wallet
|
||||
|
||||
May be performed in/from (depending on other flags):
|
||||
WalletManager
|
||||
*/
|
||||
RecurseFolder
|
||||
/*
|
||||
RecurseWalletItem indicates that all WalletItem entries should have (WalletItem).Update() called.
|
||||
If present, it takes precedent over all over relevant RecurseOptsFlags present
|
||||
(RecursePassword, RecurseMap, RecurseBlob, RecurseUnknown).
|
||||
|
||||
Performed in/from:
|
||||
Folder
|
||||
|
||||
May be performed in/from (depending on other flags):
|
||||
WalletManager
|
||||
Wallet
|
||||
*/
|
||||
RecurseWalletItem
|
||||
/*
|
||||
RecursePassword indicates that Password objects should have Password.Update() called.
|
||||
|
||||
Performed in/from:
|
||||
Folder
|
||||
|
||||
May be performed in/from (depending on other flags):
|
||||
WalletManager
|
||||
Wallet
|
||||
*/
|
||||
RecursePassword
|
||||
/*
|
||||
RecurseMap indicates that Map objects should have Map.Update() called.
|
||||
|
||||
Performed in/from:
|
||||
Folder
|
||||
|
||||
May be performed in/from (depending on other flags):
|
||||
WalletManager
|
||||
Wallet
|
||||
*/
|
||||
RecurseMap
|
||||
/*
|
||||
RecurseBlob indicates that Blob objects should have Blob.Update() called.
|
||||
|
||||
Performed in/from:
|
||||
Folder
|
||||
|
||||
May be performed in/from (depending on other flags):
|
||||
WalletManager
|
||||
Wallet
|
||||
*/
|
||||
RecurseBlob
|
||||
/*
|
||||
RecurseUnknown indicates that UnknownItem objects should have UnknownItem.Update() called.
|
||||
|
||||
Performed in/from:
|
||||
Folder
|
||||
|
||||
May be performed in/from (depending on other flags):
|
||||
WalletManager
|
||||
Wallet
|
||||
*/
|
||||
RecurseUnknown
|
||||
)
|
||||
|
5
go.mod
5
go.mod
@ -2,4 +2,7 @@ module r00t2.io/gokwallet
|
||||
|
||||
go 1.17
|
||||
|
||||
require github.com/godbus/dbus/v5 v5.0.6
|
||||
require (
|
||||
github.com/godbus/dbus/v5 v5.0.6
|
||||
r00t2.io/goutils v1.0.1
|
||||
)
|
||||
|
5
go.sum
5
go.sum
@ -1,2 +1,7 @@
|
||||
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro=
|
||||
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/jszwec/csvutil v1.5.0/go.mod h1:Rpu7Uu9giO9subDyMCIQfHVDuLrcaC36UA4YcJjGBkg=
|
||||
r00t2.io/goutils v1.0.1 h1:f1m2QRBF8XsW3peYf1I2q37npgf+5bmJBbrLzCFtm34=
|
||||
r00t2.io/goutils v1.0.1/go.mod h1:CMK3RGnMSyjDSfYxeFQl/oJTkkUMS1jhSTdGTkAPpQw=
|
||||
r00t2.io/sysutils v0.0.0-20210224054841-55ac47c86928/go.mod h1:XzJkBF6SHAODEszJlOcjtGoTHwYnZZNmseA6PyOujes=
|
||||
|
8
types.go
8
types.go
@ -2,6 +2,7 @@ package gokwallet
|
||||
|
||||
import (
|
||||
"github.com/godbus/dbus/v5"
|
||||
"r00t2.io/goutils/types"
|
||||
)
|
||||
|
||||
/*
|
||||
@ -131,3 +132,10 @@ type UnknownItem struct {
|
||||
type WalletItem interface {
|
||||
isWalletItem() (isWalletItem bool)
|
||||
}
|
||||
|
||||
/*
|
||||
RecurseOptsFlag is used to determine whether or not to recurse into items and fully populate them.
|
||||
One would use a types.BitMask as a parameter type and do <BitMask>.HasFlag(<RecurseOptsFlag>).
|
||||
See consts.go for the actual flags.
|
||||
*/
|
||||
type RecurseOptsFlag types.MaskBit
|
||||
|
Loading…
Reference in New Issue
Block a user