-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add generated proto for sample BYOB UDF to repo
Bug: b/374288740 Change-Id: I7a9160726a760b3f4ff904572facfd61e862c2da GitOrigin-RevId: ac4654084f80a145d4c4462a649ef67ee6f00d91
- Loading branch information
1 parent
68b191e
commit 40780f6
Showing
5 changed files
with
237 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// | ||
// Generated from: src/roma/byob/sample_udf/sample.proto | ||
// | ||
// See /docs/Guide to the SDK.md for information on using this spec. | ||
// | ||
// | ||
// SampleServer UDF Spec | ||
// A sample server showcasing declarative APIs for BYOB | ||
// | ||
|
||
syntax = "proto3"; | ||
|
||
package privacy_sandbox.roma_byob.example; | ||
|
||
|
||
|
||
|
||
// | ||
// UDF rpc: Sample | ||
// The Sample method MethodAnnotation. Add some information about this rpc | ||
// method. | ||
// request: SampleRequest | ||
// response: SampleResponse | ||
|
||
// SampleRequest specifies a single function to execute. | ||
message SampleRequest { | ||
// The function to be executed | ||
FunctionType function = 1; | ||
} | ||
|
||
// SampleResponse returns the function's output. | ||
message SampleResponse { | ||
// The payload generated by the function. | ||
string greeting = 1; | ||
// A list of prime numbers. | ||
repeated int32 prime_number = 2; | ||
} | ||
|
||
// | ||
// UDF rpc: ReadPayload | ||
// MethodAnnotation. Add some information about this rpc method. | ||
// request: ReadPayloadRequest | ||
// response: ReadPayloadResponse | ||
|
||
|
||
message ReadPayloadRequest { | ||
// The payloads sent into the UDF. | ||
repeated bytes payloads = 1; | ||
} | ||
|
||
|
||
message ReadPayloadResponse { | ||
// The size of the payloads sent to the UDF. | ||
uint64 payload_size = 1; | ||
} | ||
|
||
// | ||
// UDF rpc: GeneratePayload | ||
// MethodAnnotation. Add some information about this rpc method. | ||
// request: GeneratePayloadRequest | ||
// response: GeneratePayloadResponse | ||
|
||
|
||
message GeneratePayloadRequest { | ||
// The size of the payload elements for the UDF to generate. | ||
uint64 element_size = 1; | ||
// The number of the payload elements for the UDF to generate. | ||
uint64 element_count = 2; | ||
} | ||
|
||
|
||
message GeneratePayloadResponse { | ||
// The payloads generated by the UDF. | ||
repeated bytes payloads = 1; | ||
} | ||
|
||
// | ||
// UDF rpc: ReadCallbackPayload | ||
// MethodAnnotation | ||
// request: ReadCallbackPayloadRequest | ||
// response: ReadCallbackPayloadResponse | ||
|
||
|
||
message ReadCallbackPayloadRequest { | ||
// The size of the payload elements to generate as input to the Host API | ||
// function. | ||
uint64 element_size = 1; | ||
// The number of the payload elements to generate as input to the Host API | ||
// function. | ||
uint64 element_count = 2; | ||
} | ||
|
||
|
||
message ReadCallbackPayloadResponse { | ||
// The size of the payloads sent to the Host API function. | ||
uint64 payload_size = 1; | ||
} | ||
|
||
// | ||
// UDF rpc: WriteCallbackPayload | ||
// MethodAnnotation | ||
// request: WriteCallbackPayloadRequest | ||
// response: WriteCallbackPayloadResponse | ||
|
||
|
||
message WriteCallbackPayloadRequest { | ||
// The size of the payload elements for the Host API function to generate. | ||
uint64 element_size = 1; | ||
// The number of the payload elements for the Host API function to generate. | ||
uint64 element_count = 2; | ||
} | ||
|
||
|
||
message WriteCallbackPayloadResponse { | ||
// The size of the payloads returned by the Host API function. | ||
uint64 payload_size = 1; | ||
} | ||
|
||
// | ||
// UDF rpc: RunPrimeSieve | ||
// MethodAnnotation | ||
// request: RunPrimeSieveRequest | ||
// response: RunPrimeSieveResponse | ||
|
||
|
||
message RunPrimeSieveRequest { | ||
// The count of prime numbers to generate. | ||
int32 prime_count = 1; | ||
} | ||
|
||
|
||
message RunPrimeSieveResponse { | ||
// The Nth (and largest) of the prime numbers generated. | ||
int32 largest_prime = 1; | ||
} | ||
|
||
// | ||
// UDF rpc: SortList | ||
// MethodAnnotation | ||
// request: SortListRequest | ||
// response: SortListResponse | ||
|
||
|
||
message SortListRequest { | ||
} | ||
|
||
|
||
message SortListResponse { | ||
} | ||
|
||
|
||
// Functions that can be executed by the Sample UDF. | ||
enum FunctionType { | ||
FUNCTION_UNSPECIFIED = 0; | ||
// The hello world function. | ||
FUNCTION_HELLO_WORLD = 1; | ||
// The sieve-based prime generator function. | ||
FUNCTION_PRIME_SIEVE = 2; | ||
FUNCTION_CALLBACK = 3; | ||
FUNCTION_TEN_CALLBACK_INVOCATIONS = 4; | ||
} |
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.