Skip to content
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

Add service for embeddings #49

Merged
merged 2 commits into from
Apr 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}