Skip to content

Commit

Permalink
Merge pull request #49 from dolittle/add-embeddings
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhoisko authored Apr 13, 2021
2 parents 154ff23 + 940afda commit 0327c04
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions Source/Runtime/Embeddings/Embeddings.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

syntax = "proto3";

import "Fundamentals/Protobuf/Uuid.proto";
import "Fundamentals/Protobuf/Failure.proto";
import "Fundamentals/Services/CallContext.proto";
import "Fundamentals/Services/ReverseCallContext.proto";
import "Fundamentals/Services/Ping.proto";
import "Runtime/Events/Uncommitted.proto";
import "Runtime/Events.Processing/Projections.proto";
import "Runtime/Projections/State.proto";

package dolittle.runtime.embeddings;

option csharp_namespace = "Dolittle.Runtime.Embeddings.Contracts";
option go_package = "go.dolittle.io/contracts/runtime/embeddings";

message EmbeddingRegistrationRequest {
services.ReverseCallArgumentsContext callContext = 1;
protobuf.Uuid embeddingId = 2;
repeated events.processing.ProjectionEventSelector events = 3;
string initialState = 4;
}

message EmbeddingResponse {
services.ReverseCallResponseContext callContext = 1;
repeated events.UncommittedEvent events = 2;
protobuf.Failure failure = 3; // If not set/empty - no failure
}

message EmbeddingClientToRuntimeMessage {
oneof Message {
EmbeddingRegistrationRequest registrationRequest = 1;
EmbeddingResponse handleEmbeddingResult = 2;
events.processing.ProjectionResponse handleProjectionResult = 3;
services.Pong pong = 4;
}
}

message EmbeddingRegistrationResponse {
protobuf.Failure failure = 1; // If not set/empty - no failure
}

message EmbeddingCompareRequest {
string entityState = 1;
projections.ProjectionCurrentState projectionState = 2;
}

message EmbeddingDeleteRequest {
projections.ProjectionCurrentState projectionState = 1;
}

message EmbeddingRequest {
services.ReverseCallRequestContext callContext = 1;
oneof Request {
EmbeddingCompareRequest compare = 2;
EmbeddingDeleteRequest delete = 3;
}
}

message EmbeddingRuntimeToClientMessage {
oneof Message {
EmbeddingRegistrationResponse registrationResponse = 1;
EmbeddingRequest handleEmbeddingRequest = 2;
events.processing.ProjectionRequest handleProjectionRequest = 3;
services.Ping ping = 4;
}
}

message UpdateRequest {
services.CallRequestContext callContext = 1;
protobuf.Uuid embeddingId = 2;
string key = 3;
string state = 4;
}

message UpdateResponse {
projections.ProjectionCurrentState state = 1;
protobuf.Failure failure = 2; // If not set/empty - no failure
}

message DeleteRequest {
services.CallRequestContext callContext = 1;
protobuf.Uuid embeddingId = 2;
string key = 3;
}

message DeleteResponse {
protobuf.Failure failure = 1; // If not set/empty - no failure
}

service Embeddings {
rpc Connect(stream EmbeddingClientToRuntimeMessage) returns(stream EmbeddingRuntimeToClientMessage);
rpc Update(UpdateRequest) returns (UpdateResponse);
rpc Delete(DeleteRequest) returns (DeleteResponse);
}

0 comments on commit 0327c04

Please sign in to comment.