mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
158 lines
3.7 KiB
Protocol Buffer
158 lines
3.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
import "google/protobuf/struct.proto";
|
|
|
|
package function;
|
|
|
|
option go_package = "./proto;function";
|
|
|
|
service Function {
|
|
rpc Call(CallRequest) returns (CallResponse) {}
|
|
rpc Deploy(DeployRequest) returns (DeployResponse) {}
|
|
rpc List(ListRequest) returns (ListResponse) {}
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
|
|
rpc Describe(DescribeRequest) returns (DescribeResponse) {}
|
|
rpc Update(UpdateRequest) returns (UpdateResponse) {}
|
|
}
|
|
|
|
// Call a function by name
|
|
message CallRequest {
|
|
// Name of the function
|
|
string name = 1;
|
|
// Request body that will be passed to the function
|
|
google.protobuf.Struct request = 2;
|
|
}
|
|
|
|
message CallResponse {
|
|
// Response body that the function returned
|
|
google.protobuf.Struct response = 1;
|
|
}
|
|
|
|
// Deploy a group of functions
|
|
message DeployRequest {
|
|
// function name
|
|
string name = 1;
|
|
// github url to repo
|
|
string repo = 2;
|
|
// optional subfolder path
|
|
string subfolder = 3;
|
|
// entry point, ie. handler name in the source code
|
|
// if not provided, defaults to the name parameter
|
|
string entrypoint = 4;
|
|
// project is used for namespacing your functions
|
|
// optional. defaults to "default".
|
|
string project = 5;
|
|
// runtime/language of the function
|
|
// eg: php74,
|
|
// nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16
|
|
// dotnet3
|
|
// java11
|
|
// ruby26, ruby27
|
|
// go111, go113, go116
|
|
// python37, python38, python39
|
|
string runtime = 6;
|
|
// environment variables to pass in at runtime
|
|
map<string,string> env_vars = 7;
|
|
}
|
|
|
|
message DeployResponse {
|
|
}
|
|
|
|
// List all the deployed functions
|
|
message ListRequest {
|
|
// optional project name
|
|
string project = 1;
|
|
}
|
|
|
|
message Func {
|
|
// project of function, optional
|
|
// defaults to literal "default"
|
|
// used to namespace functions
|
|
string project = 1;
|
|
// function name
|
|
// limitation: must be unique across projects
|
|
string name = 2;
|
|
// name of handler in source code
|
|
string entrypoint = 3;
|
|
// git repo address
|
|
string repo = 4;
|
|
// subfolder path to entrypoint
|
|
string subfolder = 5;
|
|
// runtime/language of the function
|
|
// eg: php74,
|
|
// nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16
|
|
// dotnet3
|
|
// java11
|
|
// ruby26, ruby27
|
|
// go111, go113, go116
|
|
// python37, python38, python39
|
|
string runtime = 6;
|
|
// eg. ACTIVE, DEPLOY_IN_PROGRESS, OFFLINE etc
|
|
string status = 7;
|
|
// associated env vars
|
|
map<string,string> env_vars = 8;
|
|
}
|
|
|
|
message ListResponse {
|
|
// List of functions deployed
|
|
repeated Func functions = 1;
|
|
}
|
|
|
|
// Delete a function by name
|
|
message DeleteRequest {
|
|
// The name of the function
|
|
string name = 1;
|
|
// Optional project name
|
|
string project = 2;
|
|
}
|
|
|
|
message DeleteResponse {
|
|
|
|
}
|
|
|
|
// Get the info for a deployed function
|
|
message DescribeRequest {
|
|
// The name of the function
|
|
string name = 1;
|
|
// Optional project name
|
|
string project = 2;
|
|
}
|
|
|
|
message DescribeResponse {
|
|
// The function requested
|
|
Func function = 1;
|
|
// The time at which the function was updated
|
|
string updated_at = 2;
|
|
// The timeout for requests to the function
|
|
string timeout = 3;
|
|
}
|
|
|
|
// Update a function
|
|
message UpdateRequest {
|
|
// function name
|
|
string name = 1;
|
|
// github url to repo
|
|
string repo = 2;
|
|
// optional subfolder path
|
|
string subfolder = 3;
|
|
// entry point, ie. handler name in the source code
|
|
// if not provided, defaults to the name parameter
|
|
string entrypoint = 4;
|
|
// project is used for namespacing your functions
|
|
// optional. defaults to "default".
|
|
string project = 5;
|
|
// runtime/language of the function
|
|
// eg: php74,
|
|
// nodejs6, nodejs8, nodejs10, nodejs12, nodejs14, nodejs16
|
|
// dotnet3
|
|
// java11
|
|
// ruby26, ruby27
|
|
// go111, go113, go116
|
|
// python37, python38, python39
|
|
string runtime = 6;
|
|
// environment variables to pass in at runtime
|
|
map<string,string> env_vars = 7;
|
|
}
|
|
|
|
message UpdateResponse {
|
|
}
|