-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update event sourced entity template proto to be counter example
- Loading branch information
Showing
10 changed files
with
166 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
npm-js/create-kalix-entity/template/event-sourced-entity/proto/counter_api.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// This is the public API offered by your entity. | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "kalix/annotations.proto"; | ||
import "google/api/annotations.proto"; | ||
|
||
package com.example; | ||
|
||
message IncreaseValue { | ||
string counter_id = 1 [(kalix.field).entity_key = true]; | ||
int32 value = 2; | ||
} | ||
|
||
message DecreaseValue { | ||
string counter_id = 1 [(kalix.field).entity_key = true]; | ||
int32 value = 2; | ||
} | ||
|
||
message ResetValue { | ||
string counter_id = 1 [(kalix.field).entity_key = true]; | ||
} | ||
|
||
message GetCounter { | ||
string counter_id = 1 [(kalix.field).entity_key = true]; | ||
} | ||
|
||
message CurrentCounter { | ||
int32 value = 1; | ||
} | ||
|
||
service CounterService { | ||
option (kalix.service) = { | ||
type : SERVICE_TYPE_ENTITY | ||
component : ".domain.Counter" | ||
}; | ||
|
||
rpc Increase(IncreaseValue) returns (google.protobuf.Empty); | ||
rpc Decrease(DecreaseValue) returns (google.protobuf.Empty); | ||
rpc Reset(ResetValue) returns (google.protobuf.Empty); | ||
rpc GetCurrentCounter(GetCounter) returns (CurrentCounter); | ||
} |
28 changes: 28 additions & 0 deletions
28
npm-js/create-kalix-entity/template/event-sourced-entity/proto/counter_domain.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
syntax = "proto3"; | ||
|
||
package com.example.domain; | ||
|
||
import "kalix/annotations.proto"; | ||
|
||
option (kalix.file).event_sourced_entity = { | ||
name: "Counter" | ||
entity_type: "counter" | ||
state: "CounterState" | ||
events: "ValueIncreased" | ||
events: "ValueDecreased" | ||
events: "ValueReset" | ||
}; | ||
|
||
message CounterState { | ||
int32 value = 1; | ||
} | ||
|
||
message ValueIncreased { | ||
int32 value = 1; | ||
} | ||
|
||
message ValueDecreased { | ||
int32 value = 1; | ||
} | ||
|
||
message ValueReset {} |
30 changes: 0 additions & 30 deletions
30
npm-js/create-kalix-entity/template/event-sourced-entity/proto/myentity_api.proto
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
npm-js/create-kalix-entity/template/event-sourced-entity/proto/myentity_domain.proto
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.