mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 07:15:25 +00:00
function: Describe + Delete endpoints (#230)
This commit is contained in:
@@ -34,6 +34,12 @@ func (t *FunctionService) Deploy(request *DeployRequest) (*DeployResponse, error
|
|||||||
return rsp, t.client.Call("function", "Deploy", request, rsp)
|
return rsp, t.client.Call("function", "Deploy", request, rsp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
func (t *FunctionService) Describe(request *DescribeRequest) (*DescribeResponse, error) {
|
||||||
|
rsp := &DescribeResponse{}
|
||||||
|
return rsp, t.client.Call("function", "Describe", request, rsp)
|
||||||
|
}
|
||||||
|
|
||||||
// List all the deployed functions
|
// List all the deployed functions
|
||||||
func (t *FunctionService) List(request *ListRequest) (*ListResponse, error) {
|
func (t *FunctionService) List(request *ListRequest) (*ListResponse, error) {
|
||||||
rsp := &ListResponse{}
|
rsp := &ListResponse{}
|
||||||
@@ -89,10 +95,24 @@ type DeployRequest struct {
|
|||||||
type DeployResponse struct {
|
type DeployResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeRequest struct {
|
||||||
|
// The name of the function
|
||||||
|
Name string `json:"name"`
|
||||||
|
// Optional project name
|
||||||
|
Project string `json:"project"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
Timeout string `json:"timeout"`
|
||||||
|
UpdateTime string `json:"updateTime"`
|
||||||
|
}
|
||||||
|
|
||||||
type Func struct {
|
type Func struct {
|
||||||
// name of handler in source code
|
// name of handler in source code
|
||||||
Entrypoint string `json:"entrypoint"`
|
Entrypoint string `json:"entrypoint"`
|
||||||
// function name
|
// function name
|
||||||
|
// limitation: must be unique across projects
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
// project of function, optional
|
// project of function, optional
|
||||||
// defaults to literal "default"
|
// defaults to literal "default"
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ export class FunctionService {
|
|||||||
request
|
request
|
||||||
) as Promise<DeployResponse>;
|
) as Promise<DeployResponse>;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
describe(request: DescribeRequest): Promise<DescribeResponse> {
|
||||||
|
return this.client.call(
|
||||||
|
"function",
|
||||||
|
"Describe",
|
||||||
|
request
|
||||||
|
) as Promise<DescribeResponse>;
|
||||||
|
}
|
||||||
// List all the deployed functions
|
// List all the deployed functions
|
||||||
list(request: ListRequest): Promise<ListResponse> {
|
list(request: ListRequest): Promise<ListResponse> {
|
||||||
return this.client.call(
|
return this.client.call(
|
||||||
@@ -87,10 +95,24 @@ export interface DeployRequest {
|
|||||||
|
|
||||||
export interface DeployResponse {}
|
export interface DeployResponse {}
|
||||||
|
|
||||||
|
export interface DescribeRequest {
|
||||||
|
// The name of the function
|
||||||
|
name?: string;
|
||||||
|
// Optional project name
|
||||||
|
project?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DescribeResponse {
|
||||||
|
status?: string;
|
||||||
|
timeout?: string;
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Func {
|
export interface Func {
|
||||||
// name of handler in source code
|
// name of handler in source code
|
||||||
entrypoint?: string;
|
entrypoint?: string;
|
||||||
// function name
|
// function name
|
||||||
|
// limitation: must be unique across projects
|
||||||
name?: string;
|
name?: string;
|
||||||
// project of function, optional
|
// project of function, optional
|
||||||
// defaults to literal "default"
|
// defaults to literal "default"
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ func UpdateArecord() {
|
|||||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
rsp, err := dbService.Update(&db.UpdateRequest{
|
rsp, err := dbService.Update(&db.UpdateRequest{
|
||||||
Record: map[string]interface{}{
|
Record: map[string]interface{}{
|
||||||
"id": "1",
|
|
||||||
"age": 43,
|
"age": 43,
|
||||||
|
"id": "1",
|
||||||
},
|
},
|
||||||
Table: "users",
|
Table: "users",
|
||||||
})
|
})
|
||||||
|
|||||||
7
examples/function/describe/curl/describeFunctionStatus.sh
Executable file
7
examples/function/describe/curl/describeFunctionStatus.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
curl "https://api.m3o.com/v1/function/Describe" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||||
|
-d '{
|
||||||
|
"name": "my-first-func",
|
||||||
|
"project": "tests"
|
||||||
|
}'
|
||||||
17
examples/function/describe/go/describeFunctionStatus.go
Executable file
17
examples/function/describe/go/describeFunctionStatus.go
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
package example
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/micro/services/clients/go/function"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
//
|
||||||
|
func DescribeFunctionStatus() {
|
||||||
|
functionService := function.NewFunctionService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
|
rsp, err := functionService.Describe(&function.DescribeRequest{
|
||||||
|
Name: "my-first-func",
|
||||||
|
Project: "tests",
|
||||||
|
})
|
||||||
|
fmt.Println(rsp, err)
|
||||||
|
}
|
||||||
13
examples/function/describe/node/describeFunctionStatus.js
Executable file
13
examples/function/describe/node/describeFunctionStatus.js
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
import * as fx from "m3o/function";
|
||||||
|
|
||||||
|
//
|
||||||
|
async function DescribeFunctionStatus() {
|
||||||
|
let functionService = new fx.FunctionService(process.env.MICRO_API_TOKEN);
|
||||||
|
let rsp = await functionService.describe({
|
||||||
|
name: "my-first-func",
|
||||||
|
project: "tests",
|
||||||
|
});
|
||||||
|
console.log(rsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
await DescribeFunctionStatus();
|
||||||
@@ -54,5 +54,19 @@
|
|||||||
},
|
},
|
||||||
"response": {}
|
"response": {}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"describe": [
|
||||||
|
{
|
||||||
|
"title": "Describe function status",
|
||||||
|
"request": {
|
||||||
|
"project": "tests",
|
||||||
|
"name": "my-first-func"
|
||||||
|
},
|
||||||
|
"response": {
|
||||||
|
"updateTime": "2021-10-08T10:17:34.914Z",
|
||||||
|
"status": "ACTIVE",
|
||||||
|
"timeout": "60s"
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/micro/micro/v3/service/config"
|
"github.com/micro/micro/v3/service/config"
|
||||||
log "github.com/micro/micro/v3/service/logger"
|
log "github.com/micro/micro/v3/service/logger"
|
||||||
|
"gopkg.in/yaml.v2"
|
||||||
|
|
||||||
"github.com/micro/micro/v3/service/runtime/source/git"
|
"github.com/micro/micro/v3/service/runtime/source/git"
|
||||||
|
|
||||||
@@ -224,7 +225,31 @@ func (e *Function) Call(ctx context.Context, req *function.CallRequest, rsp *fun
|
|||||||
|
|
||||||
func (e *Function) Delete(ctx context.Context, req *function.DeleteRequest, rsp *function.DeleteResponse) error {
|
func (e *Function) Delete(ctx context.Context, req *function.DeleteRequest, rsp *function.DeleteResponse) error {
|
||||||
log.Info("Received Function.Delete request")
|
log.Info("Received Function.Delete request")
|
||||||
return fmt.Errorf("not implemented yet")
|
|
||||||
|
tenantId, ok := tenant.FromContext(ctx)
|
||||||
|
if !ok {
|
||||||
|
tenantId = "micro"
|
||||||
|
}
|
||||||
|
multitenantPrefix := strings.Replace(tenantId, "/", "-", -1)
|
||||||
|
|
||||||
|
project := req.Project
|
||||||
|
if project == "" {
|
||||||
|
project = "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := exec.Command("gcloud", "functions", "delete", "--project", e.project, "--region", "europe-west1", multitenantPrefix+"-"+req.Name)
|
||||||
|
outp, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
log.Error(fmt.Errorf(string(outp)))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
id := fmt.Sprintf("%v-%v-%v", tenantId, project, req.Name)
|
||||||
|
_, err = e.db.Delete(ctx, &db.DeleteRequest{
|
||||||
|
Table: "functions",
|
||||||
|
Id: id,
|
||||||
|
})
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Function) List(ctx context.Context, req *function.ListRequest, rsp *function.ListResponse) error {
|
func (e *Function) List(ctx context.Context, req *function.ListRequest, rsp *function.ListResponse) error {
|
||||||
@@ -280,3 +305,32 @@ func (e *Function) List(ctx context.Context, req *function.ListRequest, rsp *fun
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *Function) Describe(ctx context.Context, req *function.DescribeRequest, rsp *function.DescribeResponse) error {
|
||||||
|
tenantId, ok := tenant.FromContext(ctx)
|
||||||
|
if !ok {
|
||||||
|
tenantId = "micro"
|
||||||
|
}
|
||||||
|
project := req.Project
|
||||||
|
if project == "" {
|
||||||
|
project = "default"
|
||||||
|
}
|
||||||
|
multitenantPrefix := strings.Replace(tenantId, "/", "-", -1)
|
||||||
|
|
||||||
|
cmd := exec.Command("gcloud", "functions", "describe", "--region", "europe-west1", "--project", e.project, multitenantPrefix+"-"+req.Name)
|
||||||
|
outp, err := cmd.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
log.Error(fmt.Errorf(string(outp)))
|
||||||
|
return fmt.Errorf("function does not exist")
|
||||||
|
}
|
||||||
|
log.Info(string(outp))
|
||||||
|
m := map[string]interface{}{}
|
||||||
|
err = yaml.Unmarshal(outp, m)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
rsp.Status = m["status"].(string)
|
||||||
|
rsp.Timeout = m["timeout"].(string)
|
||||||
|
rsp.UpdateTime = m["updateTime"].(string)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -327,6 +327,7 @@ type Func struct {
|
|||||||
// used to namespace functions
|
// used to namespace functions
|
||||||
Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
|
Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
|
||||||
// function name
|
// function name
|
||||||
|
// limitation: must be unique across projects
|
||||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
// name of handler in source code
|
// name of handler in source code
|
||||||
Entrypoint string `protobuf:"bytes,3,opt,name=entrypoint,proto3" json:"entrypoint,omitempty"`
|
Entrypoint string `protobuf:"bytes,3,opt,name=entrypoint,proto3" json:"entrypoint,omitempty"`
|
||||||
@@ -343,7 +344,7 @@ type Func struct {
|
|||||||
// go111, go113, go116
|
// go111, go113, go116
|
||||||
// python37, python38, python39
|
// python37, python38, python39
|
||||||
Runtime string `protobuf:"bytes,6,opt,name=runtime,proto3" json:"runtime,omitempty"`
|
Runtime string `protobuf:"bytes,6,opt,name=runtime,proto3" json:"runtime,omitempty"`
|
||||||
// eg. ACTIVE etc
|
// eg. ACTIVE, DEPLOY_IN_PROGRESS, OFFLINE etc
|
||||||
Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"`
|
Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,10 +483,10 @@ type DeleteRequest struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Optional project name
|
|
||||||
Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"`
|
|
||||||
// The name of the function
|
// The name of the function
|
||||||
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
// Optional project name
|
||||||
|
Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteRequest) Reset() {
|
func (x *DeleteRequest) Reset() {
|
||||||
@@ -520,16 +521,16 @@ func (*DeleteRequest) Descriptor() ([]byte, []int) {
|
|||||||
return file_proto_function_proto_rawDescGZIP(), []int{7}
|
return file_proto_function_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteRequest) GetProject() string {
|
func (x *DeleteRequest) GetName() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Project
|
return x.Name
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DeleteRequest) GetName() string {
|
func (x *DeleteRequest) GetProject() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Name
|
return x.Project
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
@@ -572,6 +573,126 @@ func (*DeleteResponse) Descriptor() ([]byte, []int) {
|
|||||||
return file_proto_function_proto_rawDescGZIP(), []int{8}
|
return file_proto_function_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DescribeRequest struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
// The name of the function
|
||||||
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||||
|
// Optional project name
|
||||||
|
Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeRequest) Reset() {
|
||||||
|
*x = DescribeRequest{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_function_proto_msgTypes[9]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DescribeRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DescribeRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_function_proto_msgTypes[9]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DescribeRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DescribeRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_function_proto_rawDescGZIP(), []int{9}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeRequest) GetName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeRequest) GetProject() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Project
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type DescribeResponse struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
UpdateTime string `protobuf:"bytes,1,opt,name=updateTime,proto3" json:"updateTime,omitempty"`
|
||||||
|
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
|
||||||
|
Timeout string `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeResponse) Reset() {
|
||||||
|
*x = DescribeResponse{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proto_function_proto_msgTypes[10]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DescribeResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DescribeResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proto_function_proto_msgTypes[10]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DescribeResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DescribeResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proto_function_proto_rawDescGZIP(), []int{10}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeResponse) GetUpdateTime() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UpdateTime
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeResponse) GetStatus() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Status
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DescribeResponse) GetTimeout() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Timeout
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_proto_function_proto protoreflect.FileDescriptor
|
var File_proto_function_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_proto_function_proto_rawDesc = []byte{
|
var file_proto_function_proto_rawDesc = []byte{
|
||||||
@@ -619,29 +740,43 @@ var file_proto_function_proto_rawDesc = []byte{
|
|||||||
0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
|
0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
|
||||||
0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x52, 0x09,
|
0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x46, 0x75, 0x6e, 0x63, 0x52, 0x09,
|
||||||
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x44, 0x65, 0x6c,
|
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3d, 0x0a, 0x0d, 0x44, 0x65, 0x6c,
|
||||||
0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72,
|
0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
|
||||||
0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f,
|
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18,
|
||||||
0x6a, 0x65, 0x63, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65,
|
0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65,
|
||||||
0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xfa, 0x01, 0x0a, 0x08, 0x46,
|
0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x0f, 0x44, 0x65,
|
||||||
0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12,
|
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a,
|
||||||
0x15, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52,
|
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
|
||||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
|
0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
|
0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x64, 0x0a, 0x10, 0x44,
|
||||||
0x12, 0x3d, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x12, 0x17, 0x2e, 0x66, 0x75, 0x6e,
|
0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
||||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x75,
|
0x1e, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20,
|
||||||
0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44,
|
0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||||
0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x37, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
|
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f,
|
||||||
0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
|
0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75,
|
||||||
|
0x74, 0x32, 0xbf, 0x02, 0x0a, 0x08, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37,
|
||||||
|
0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x15, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
|
||||||
|
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x06, 0x44, 0x65, 0x70, 0x6c, 0x6f,
|
||||||
|
0x79, 0x12, 0x17, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70,
|
||||||
|
0x6c, 0x6f, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x66, 0x75, 0x6e,
|
||||||
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x52, 0x65, 0x73, 0x70,
|
||||||
|
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15,
|
||||||
0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
|
0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
0x74, 0x65, 0x12, 0x17, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65,
|
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
|
||||||
0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x66, 0x75,
|
0x3d, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x17, 0x2e, 0x66, 0x75, 0x6e, 0x63,
|
||||||
0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73,
|
0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x12, 0x5a, 0x10, 0x2e, 0x2f, 0x70, 0x72, 0x6f,
|
0x73, 0x74, 0x1a, 0x18, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65,
|
||||||
0x74, 0x6f, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43,
|
||||||
0x74, 0x6f, 0x33,
|
0x0a, 0x08, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x19, 0x2e, 0x66, 0x75, 0x6e,
|
||||||
|
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65,
|
||||||
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||||
|
0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
|
0x65, 0x22, 0x00, 0x42, 0x12, 0x5a, 0x10, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x66,
|
||||||
|
0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -656,36 +791,40 @@ func file_proto_function_proto_rawDescGZIP() []byte {
|
|||||||
return file_proto_function_proto_rawDescData
|
return file_proto_function_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_proto_function_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
var file_proto_function_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||||
var file_proto_function_proto_goTypes = []interface{}{
|
var file_proto_function_proto_goTypes = []interface{}{
|
||||||
(*CallRequest)(nil), // 0: function.CallRequest
|
(*CallRequest)(nil), // 0: function.CallRequest
|
||||||
(*CallResponse)(nil), // 1: function.CallResponse
|
(*CallResponse)(nil), // 1: function.CallResponse
|
||||||
(*DeployRequest)(nil), // 2: function.DeployRequest
|
(*DeployRequest)(nil), // 2: function.DeployRequest
|
||||||
(*DeployResponse)(nil), // 3: function.DeployResponse
|
(*DeployResponse)(nil), // 3: function.DeployResponse
|
||||||
(*ListRequest)(nil), // 4: function.ListRequest
|
(*ListRequest)(nil), // 4: function.ListRequest
|
||||||
(*Func)(nil), // 5: function.Func
|
(*Func)(nil), // 5: function.Func
|
||||||
(*ListResponse)(nil), // 6: function.ListResponse
|
(*ListResponse)(nil), // 6: function.ListResponse
|
||||||
(*DeleteRequest)(nil), // 7: function.DeleteRequest
|
(*DeleteRequest)(nil), // 7: function.DeleteRequest
|
||||||
(*DeleteResponse)(nil), // 8: function.DeleteResponse
|
(*DeleteResponse)(nil), // 8: function.DeleteResponse
|
||||||
(*_struct.Struct)(nil), // 9: google.protobuf.Struct
|
(*DescribeRequest)(nil), // 9: function.DescribeRequest
|
||||||
|
(*DescribeResponse)(nil), // 10: function.DescribeResponse
|
||||||
|
(*_struct.Struct)(nil), // 11: google.protobuf.Struct
|
||||||
}
|
}
|
||||||
var file_proto_function_proto_depIdxs = []int32{
|
var file_proto_function_proto_depIdxs = []int32{
|
||||||
9, // 0: function.CallRequest.request:type_name -> google.protobuf.Struct
|
11, // 0: function.CallRequest.request:type_name -> google.protobuf.Struct
|
||||||
9, // 1: function.CallResponse.response:type_name -> google.protobuf.Struct
|
11, // 1: function.CallResponse.response:type_name -> google.protobuf.Struct
|
||||||
5, // 2: function.ListResponse.functions:type_name -> function.Func
|
5, // 2: function.ListResponse.functions:type_name -> function.Func
|
||||||
0, // 3: function.Function.Call:input_type -> function.CallRequest
|
0, // 3: function.Function.Call:input_type -> function.CallRequest
|
||||||
2, // 4: function.Function.Deploy:input_type -> function.DeployRequest
|
2, // 4: function.Function.Deploy:input_type -> function.DeployRequest
|
||||||
4, // 5: function.Function.List:input_type -> function.ListRequest
|
4, // 5: function.Function.List:input_type -> function.ListRequest
|
||||||
7, // 6: function.Function.Delete:input_type -> function.DeleteRequest
|
7, // 6: function.Function.Delete:input_type -> function.DeleteRequest
|
||||||
1, // 7: function.Function.Call:output_type -> function.CallResponse
|
9, // 7: function.Function.Describe:input_type -> function.DescribeRequest
|
||||||
3, // 8: function.Function.Deploy:output_type -> function.DeployResponse
|
1, // 8: function.Function.Call:output_type -> function.CallResponse
|
||||||
6, // 9: function.Function.List:output_type -> function.ListResponse
|
3, // 9: function.Function.Deploy:output_type -> function.DeployResponse
|
||||||
8, // 10: function.Function.Delete:output_type -> function.DeleteResponse
|
6, // 10: function.Function.List:output_type -> function.ListResponse
|
||||||
7, // [7:11] is the sub-list for method output_type
|
8, // 11: function.Function.Delete:output_type -> function.DeleteResponse
|
||||||
3, // [3:7] is the sub-list for method input_type
|
10, // 12: function.Function.Describe:output_type -> function.DescribeResponse
|
||||||
3, // [3:3] is the sub-list for extension type_name
|
8, // [8:13] is the sub-list for method output_type
|
||||||
3, // [3:3] is the sub-list for extension extendee
|
3, // [3:8] is the sub-list for method input_type
|
||||||
0, // [0:3] is the sub-list for field type_name
|
3, // [3:3] is the sub-list for extension type_name
|
||||||
|
3, // [3:3] is the sub-list for extension extendee
|
||||||
|
0, // [0:3] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_proto_function_proto_init() }
|
func init() { file_proto_function_proto_init() }
|
||||||
@@ -802,6 +941,30 @@ func file_proto_function_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_proto_function_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DescribeRequest); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_proto_function_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DescribeResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@@ -809,7 +972,7 @@ func file_proto_function_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_proto_function_proto_rawDesc,
|
RawDescriptor: file_proto_function_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 9,
|
NumMessages: 11,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ type FunctionService interface {
|
|||||||
Deploy(ctx context.Context, in *DeployRequest, opts ...client.CallOption) (*DeployResponse, error)
|
Deploy(ctx context.Context, in *DeployRequest, opts ...client.CallOption) (*DeployResponse, error)
|
||||||
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
|
List(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
|
||||||
Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
|
Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error)
|
||||||
|
Describe(ctx context.Context, in *DescribeRequest, opts ...client.CallOption) (*DescribeResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type functionService struct {
|
type functionService struct {
|
||||||
@@ -101,6 +102,16 @@ func (c *functionService) Delete(ctx context.Context, in *DeleteRequest, opts ..
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *functionService) Describe(ctx context.Context, in *DescribeRequest, opts ...client.CallOption) (*DescribeResponse, error) {
|
||||||
|
req := c.c.NewRequest(c.name, "Function.Describe", in)
|
||||||
|
out := new(DescribeResponse)
|
||||||
|
err := c.c.Call(ctx, req, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Server API for Function service
|
// Server API for Function service
|
||||||
|
|
||||||
type FunctionHandler interface {
|
type FunctionHandler interface {
|
||||||
@@ -108,6 +119,7 @@ type FunctionHandler interface {
|
|||||||
Deploy(context.Context, *DeployRequest, *DeployResponse) error
|
Deploy(context.Context, *DeployRequest, *DeployResponse) error
|
||||||
List(context.Context, *ListRequest, *ListResponse) error
|
List(context.Context, *ListRequest, *ListResponse) error
|
||||||
Delete(context.Context, *DeleteRequest, *DeleteResponse) error
|
Delete(context.Context, *DeleteRequest, *DeleteResponse) error
|
||||||
|
Describe(context.Context, *DescribeRequest, *DescribeResponse) error
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterFunctionHandler(s server.Server, hdlr FunctionHandler, opts ...server.HandlerOption) error {
|
func RegisterFunctionHandler(s server.Server, hdlr FunctionHandler, opts ...server.HandlerOption) error {
|
||||||
@@ -116,6 +128,7 @@ func RegisterFunctionHandler(s server.Server, hdlr FunctionHandler, opts ...serv
|
|||||||
Deploy(ctx context.Context, in *DeployRequest, out *DeployResponse) error
|
Deploy(ctx context.Context, in *DeployRequest, out *DeployResponse) error
|
||||||
List(ctx context.Context, in *ListRequest, out *ListResponse) error
|
List(ctx context.Context, in *ListRequest, out *ListResponse) error
|
||||||
Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error
|
Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error
|
||||||
|
Describe(ctx context.Context, in *DescribeRequest, out *DescribeResponse) error
|
||||||
}
|
}
|
||||||
type Function struct {
|
type Function struct {
|
||||||
function
|
function
|
||||||
@@ -143,3 +156,7 @@ func (h *functionHandler) List(ctx context.Context, in *ListRequest, out *ListRe
|
|||||||
func (h *functionHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error {
|
func (h *functionHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error {
|
||||||
return h.FunctionHandler.Delete(ctx, in, out)
|
return h.FunctionHandler.Delete(ctx, in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *functionHandler) Describe(ctx context.Context, in *DescribeRequest, out *DescribeResponse) error {
|
||||||
|
return h.FunctionHandler.Describe(ctx, in, out)
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ service Function {
|
|||||||
rpc Deploy(DeployRequest) returns (DeployResponse) {}
|
rpc Deploy(DeployRequest) returns (DeployResponse) {}
|
||||||
rpc List(ListRequest) returns (ListResponse) {}
|
rpc List(ListRequest) returns (ListResponse) {}
|
||||||
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
|
rpc Delete(DeleteRequest) returns (DeleteResponse) {}
|
||||||
|
rpc Describe(DescribeRequest) returns (DescribeResponse) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call a function by name
|
// Call a function by name
|
||||||
@@ -65,6 +66,7 @@ message Func {
|
|||||||
// used to namespace functions
|
// used to namespace functions
|
||||||
string project = 1;
|
string project = 1;
|
||||||
// function name
|
// function name
|
||||||
|
// limitation: must be unique across projects
|
||||||
string name = 2;
|
string name = 2;
|
||||||
// name of handler in source code
|
// name of handler in source code
|
||||||
string entrypoint = 3;
|
string entrypoint = 3;
|
||||||
@@ -92,12 +94,25 @@ message ListResponse {
|
|||||||
|
|
||||||
// Delete a function by name
|
// Delete a function by name
|
||||||
message DeleteRequest {
|
message DeleteRequest {
|
||||||
// Optional project name
|
|
||||||
string project = 1;
|
|
||||||
// The name of the function
|
// The name of the function
|
||||||
string name = 2;
|
string name = 1;
|
||||||
|
// Optional project name
|
||||||
|
string project = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DeleteResponse {
|
message DeleteResponse {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message DescribeRequest {
|
||||||
|
// The name of the function
|
||||||
|
string name = 1;
|
||||||
|
// Optional project name
|
||||||
|
string project = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DescribeResponse {
|
||||||
|
string updateTime = 1;
|
||||||
|
string status = 2;
|
||||||
|
string timeout = 3;
|
||||||
|
}
|
||||||
1
go.mod
1
go.mod
@@ -60,6 +60,7 @@ require (
|
|||||||
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4 // indirect
|
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4 // indirect
|
||||||
google.golang.org/protobuf v1.27.1
|
google.golang.org/protobuf v1.27.1
|
||||||
googlemaps.github.io/maps v1.3.1
|
googlemaps.github.io/maps v1.3.1
|
||||||
|
gopkg.in/yaml.v2 v2.3.0
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
|
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
|
||||||
gorm.io/datatypes v1.0.1
|
gorm.io/datatypes v1.0.1
|
||||||
gorm.io/driver/postgres v1.0.8
|
gorm.io/driver/postgres v1.0.8
|
||||||
|
|||||||
Reference in New Issue
Block a user