In the state API there's an existing DeleteStateWithETag() convenience
function but there does not appear to be an equivalent
SaveStateWithETag(). This commit adds SetStateWithETag() so that
consumers of the SDK don't have to employ the more verbose
SaveBulkState() when they only need to update a singular item.
Client code updating a single item with an etag prior to this commit
looks like:
--
item := &dapr.SetStateItem{
Etag: &dapr.ETag{
Value: "deadbeef",
},
Key: "order_1",
Value: []byte(data),
}
err := client.SaveBulkState(ctx, store, item)
--
Client code after this commit can reduce to:
--
err := client.SaveStateWithEtag(ctx, store, "order_1", []byte(data), "deadbeef")
--
Signed-off-by: Mike Brown <github@torvosoft.com>
Signed-off-by: Mike Brown <github@torvosoft.com>
* update GetBulkState method: add metedata, change return struct to BulkStateItem
* generate code from dapr proto files; support metadata in get response
* update for code review
* options
* service, topic test
* binding, invoke, topic tests
* split coveage on projects
* cleaned up test
* cleaned up release test
* badge to main vs master
* madditional trace ID test
* adds secret input test
* state tests and lint
* WIP: server
* gRPC server implementaiton
* http serving
* grpc ports as string vs int
* bump tag
* adds ctx, fixes linting errors
* v0.8.2 bump
* fixes serving options
* cleans up cloud events in gttp serving
* v0.8.4 version bump
* uses http method constant
* adds grpc serving tests
* pubsub evnet as bytes
* adds tests, seperate payload between http, grpc
* refactored names, tests
* fixes release names
* fixes versoin number
* http invoke test, grpc invoke params
* makefile updates
* readme updates, fixes grpc to http invocations
* readme updates
* comments, refactored http service
* more serving tests
* more client tests
* test verbocity
* fixes grpc error serializtion error
* adds serving to readme
* code formatting
* adds support for TypeUrl in case of a proto conten
* added binding in http service
* cron in grpc example
* single interface for grpc and http sdks
* normalized serving interfaces across http and grpc
* unit, rest api tests for grpc, html serving
* updated tests
* resolved master conflicts
* changes from @youngbupark review
* overloaded AddTopicEventHandler for ease of use
* updated to go 1.15, dependancies
* updated actions to go 1.15
* service test coverage
* readme and release version updates
* makefile flag options for dapr v0.9
* serving to grpc package for ease of http imp