Commit 08bcbde1 authored by Akshay Mahendrakar's avatar Akshay Mahendrakar
Browse files

prepareOptions - Appending specific keys to []opts (whose values are not default)

parent a2f253b7
2 merge requests!270Core ImmuDB package and TOTP plugin - Implementation,!269Core ImmuDB package and TOTP plugin - Implementation
Showing with 13 additions and 4 deletions
......@@ -407,9 +407,18 @@ func (i *ImmuDAO) CreateUser(username, password, dbName string, permission int)
func prepareOptions(getOpts GetOptions) []immudb.GetOption {
var opts []immudb.GetOption
opts = append(opts, immudb.AtTx(getOpts.AtTx))
opts = append(opts, immudb.SinceTx(getOpts.SinceTx))
opts = append(opts, immudb.NoWait(getOpts.NoWait))
opts = append(opts, immudb.AtRevision(getOpts.AtRevision))
if getOpts.AtTx != 0 {
opts = append(opts, immudb.AtTx(getOpts.AtTx))
}
if getOpts.SinceTx != 0 {
opts = append(opts, immudb.SinceTx(getOpts.SinceTx))
}
if getOpts.NoWait {
opts = append(opts, immudb.NoWait(getOpts.NoWait))
}
if getOpts.AtRevision != 0 {
opts = append(opts, immudb.AtRevision(getOpts.AtRevision))
}
return opts
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment