-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: collections API #894
Conversation
please don't merge master as of now in this branch ty. |
|
||
objs := []KeyValue[keys.StringKey, wellknown.BytesValue, *wellknown.BytesValue]{kv("a"), kv("aa"), kv("b"), kv("bb")} | ||
|
||
m.Insert(ctx, "a", obj("a")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this Insert
redundant since kv("a")
creates the obj already?
// Order defines the ordering of keys. | ||
type Order uint8 | ||
|
||
const ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want to support other iteration patterns (e.g. like random access) since they are non-deterministic. I would consider if a boolean for AccessOrder is simpler than an iota. Something like true = ascending, false = descending
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the intention is to have only two iteration orders. It's just that in go there are no enums, and having booleans in constants that work like enums is not common, so I went for u8 which is the smallest value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDK if @AgentSmithMatrix has some other feedback.
@NibiruHeisenberg , @AgentSmithMatrix there's also another point that I would like to understand before merging this. A lot of Mapping methods want to map primitive types:
Currently the only way to do this is to use prototypes BytesValue StringValue etc. Which make setting/getting/using the values verbose ex: For the sake of simplification we can:
|
Description
Introduces the unified state layer
Purpose
Makes state handlings things easier and safer and standardized.
closes: #895