simplesessions
simplesessions copied to clipboard
[Feature request] Chain Setting values in session
It will be great to have a feature to set values to a session, like the following.
sess, _ := session.Aquire(...,...)
err := sess.Set('key1', 'value1').Set('key2', 'value2')...Commit()
If this sounds good, I can add this feature.
Do you mean a chainable shorthand instead of the current:
sess, _ := session.Aquire(...,...)
sess.Set('key1', 'value1')
sess.Set('key2', 'value2')
sess.Commit()
Do you mean a chainable shorthand instead of the current:
Yes.
Yep, makes sense to have. Obviously, can't break the Set()
API, so we can introduce a SetM().SetM()...
(M = many / multi). @vividvilla ?
This lib doesn't use chain pattern so the ideal API would be SetMulti(arg1, val1, ...)
. @joicemjoseph If you are interested then send a PR.
Edit: we already have GetMulti(arg...)
so this conforms to current API.
I will raise a PR.