feat: support generate code from TestCase (#154)
This commit is contained in:
parent
556d58f12f
commit
a799208a0c
|
@ -60,6 +60,31 @@ function sendRequest() {
|
|||
})
|
||||
}
|
||||
|
||||
function generateCode() {
|
||||
const name = props.name
|
||||
const suite = props.suite
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
TestSuite: suite,
|
||||
TestCase: name,
|
||||
Generator: "golang"
|
||||
})
|
||||
}
|
||||
fetch('/server.Runner/GenerateCode', requestOptions)
|
||||
.then((response) => response.json())
|
||||
.then((e) => {
|
||||
ElMessage({
|
||||
message: 'Code generated!',
|
||||
type: 'success'
|
||||
})
|
||||
testResult.value.output = e.message
|
||||
})
|
||||
.catch((e) => {
|
||||
ElMessage.error('Oops, ' + e)
|
||||
})
|
||||
}
|
||||
|
||||
const queryBodyFields = (queryString: string, cb: any) => {
|
||||
if (!testResult.value.bodyObject || !FlattenObject(testResult.value.bodyObject)) {
|
||||
cb([])
|
||||
|
@ -408,6 +433,7 @@ const queryPupularHeaders = (queryString: string, cb: (arg: any) => void) => {
|
|||
</el-autocomplete>
|
||||
|
||||
<el-button type="primary" @click="sendRequest" :loading="requestLoading">Send</el-button>
|
||||
<el-button type="primary" @click="generateCode">Generator Code</el-button>
|
||||
</el-header>
|
||||
|
||||
<el-main>
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/**
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 API Testing Authors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
package generator
|
||||
|
||||
import "github.com/linuxsuren/api-testing/pkg/testing"
|
||||
|
||||
// CodeGenerator is the interface of code generator
|
||||
type CodeGenerator interface {
|
||||
Generate(testcase *testing.TestCase) (result string, err error)
|
||||
}
|
||||
|
||||
var codeGenerators = map[string]CodeGenerator{}
|
||||
|
||||
func GetCodeGenerator(name string) CodeGenerator {
|
||||
return codeGenerators[name]
|
||||
}
|
||||
|
||||
func RegisterCodeGenerator(name string, generator CodeGenerator) {
|
||||
codeGenerators[name] = generator
|
||||
}
|
||||
|
||||
func GetCodeGenerators() (result map[string]CodeGenerator) {
|
||||
// returns an immutable map
|
||||
result = make(map[string]CodeGenerator, len(codeGenerators))
|
||||
for k, v := range codeGenerators {
|
||||
result[k] = v
|
||||
}
|
||||
return
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/**
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 API Testing Authors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
package generator_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/linuxsuren/api-testing/pkg/generator"
|
||||
atest "github.com/linuxsuren/api-testing/pkg/testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestCodeGeneratorManager(t *testing.T) {
|
||||
t.Run("GetCodeGenerators", func(t *testing.T) {
|
||||
// should returns a mutable map
|
||||
generators := generator.GetCodeGenerators()
|
||||
count := len(generators)
|
||||
|
||||
generators["a-new-fake"] = nil
|
||||
assert.Equal(t, count, len(generator.GetCodeGenerators()))
|
||||
})
|
||||
|
||||
t.Run("GetCodeGenerator", func(t *testing.T) {
|
||||
instance := generator.NewGolangGenerator()
|
||||
generator.RegisterCodeGenerator("fake", instance)
|
||||
assert.Equal(t, instance, generator.GetCodeGenerator("fake"))
|
||||
})
|
||||
}
|
||||
|
||||
func TestGenerators(t *testing.T) {
|
||||
testcase := &atest.TestCase{
|
||||
Request: atest.Request{
|
||||
API: "https://www.baidu.com",
|
||||
},
|
||||
}
|
||||
t.Run("golang", func(t *testing.T) {
|
||||
result, err := generator.GetCodeGenerator("golang").Generate(testcase)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, expectedGoCode, result)
|
||||
})
|
||||
}
|
||||
|
||||
//go:embed testdata/expected_go_code.txt
|
||||
var expectedGoCode string
|
|
@ -0,0 +1,39 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
{{- if lt (len .Request.Form) 0 }}
|
||||
data := url.Values{}
|
||||
{{- range $key, $val := .Request.Form}}
|
||||
data.Set("$key", "$val")
|
||||
{{end}}
|
||||
reader := strings.NewReader(data.Encode())
|
||||
{{- else}}
|
||||
body := bytes.NewBufferString("{{.Request.Body}}")
|
||||
{{- end }}
|
||||
|
||||
req, err := http.NewRequest("{{.Request.Method}}," "{{.Request.API}}", body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
{{- range $key, $val := .Request.Header}}
|
||||
req.Header.Set("$key", "$val")
|
||||
{{end}}
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
panic("status code is not 200")
|
||||
}
|
||||
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
println(string(data))
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
/**
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 API Testing Authors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
package generator
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"html/template"
|
||||
"net/http"
|
||||
|
||||
_ "embed"
|
||||
|
||||
"github.com/linuxsuren/api-testing/pkg/testing"
|
||||
)
|
||||
|
||||
type golangGenerator struct {
|
||||
}
|
||||
|
||||
func NewGolangGenerator() CodeGenerator {
|
||||
return &golangGenerator{}
|
||||
}
|
||||
|
||||
func (g *golangGenerator) Generate(testcase *testing.TestCase) (result string, err error) {
|
||||
if testcase.Request.Method == "" {
|
||||
testcase.Request.Method = http.MethodGet
|
||||
}
|
||||
var tpl *template.Template
|
||||
if tpl, err = template.New("golang template").Parse(golangTemplate); err == nil {
|
||||
buf := new(bytes.Buffer)
|
||||
if err = tpl.Execute(buf, testcase); err == nil {
|
||||
result = buf.String()
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func init() {
|
||||
RegisterCodeGenerator("golang", NewGolangGenerator())
|
||||
}
|
||||
|
||||
//go:embed data/main.go.tpl
|
||||
var golangTemplate string
|
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
body := bytes.NewBufferString("")
|
||||
|
||||
req, err := http.NewRequest("GET," "https://www.baidu.com", body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
panic("status code is not 200")
|
||||
}
|
||||
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
println(string(data))
|
||||
}
|
|
@ -15,6 +15,7 @@ import (
|
|||
_ "embed"
|
||||
|
||||
"github.com/linuxsuren/api-testing/pkg/apispec"
|
||||
"github.com/linuxsuren/api-testing/pkg/generator"
|
||||
"github.com/linuxsuren/api-testing/pkg/render"
|
||||
"github.com/linuxsuren/api-testing/pkg/runner"
|
||||
"github.com/linuxsuren/api-testing/pkg/testing"
|
||||
|
@ -462,6 +463,43 @@ func (s *server) DeleteTestCase(ctx context.Context, in *TestCaseIdentity) (repl
|
|||
return
|
||||
}
|
||||
|
||||
// code generator
|
||||
func (s *server) ListCodeGenerator(ctx context.Context, in *Empty) (reply *SimpleList, err error) {
|
||||
reply = &SimpleList{}
|
||||
|
||||
generators := generator.GetCodeGenerators()
|
||||
for name := range generators {
|
||||
reply.Data = append(reply.Data, &Pair{
|
||||
Key: name,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (s *server) GenerateCode(ctx context.Context, in *CodeGenerateRequest) (reply *CommonResult, err error) {
|
||||
reply = &CommonResult{}
|
||||
|
||||
instance := generator.GetCodeGenerator(in.Generator)
|
||||
if instance == nil {
|
||||
reply.Success = false
|
||||
reply.Message = fmt.Sprintf("generator '%s' not found", in.Generator)
|
||||
} else {
|
||||
var result testing.TestCase
|
||||
loader := s.getLoader(ctx)
|
||||
if result, err = loader.GetTestCase(in.TestSuite, in.TestCase); err == nil {
|
||||
output, genErr := instance.Generate(&result)
|
||||
if genErr != nil {
|
||||
reply.Success = false
|
||||
reply.Message = genErr.Error()
|
||||
} else {
|
||||
reply.Success = true
|
||||
reply.Message = output
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Sample returns a sample of the test task
|
||||
func (s *server) Sample(ctx context.Context, in *Empty) (reply *HelloReply, err error) {
|
||||
reply = &HelloReply{Message: sample.TestSuiteGitLab}
|
||||
|
@ -529,6 +567,7 @@ func (s *server) FunctionsQuery(ctx context.Context, in *SimpleQuery) (reply *Pa
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
// FunctionsQueryStream works like FunctionsQuery but is implemented in bidirectional streaming
|
||||
func (s *server) FunctionsQueryStream(srv Runner_FunctionsQueryStreamServer) error {
|
||||
ctx := srv.Context()
|
||||
|
|
|
@ -474,6 +474,59 @@ func TestFunctionsQuery(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestCodeGenerator(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
server := getRemoteServerInTempDir()
|
||||
|
||||
t.Run("ListCodeGenerator", func(t *testing.T) {
|
||||
generators, err := server.ListCodeGenerator(ctx, &Empty{})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 1, len(generators.Data))
|
||||
})
|
||||
|
||||
t.Run("GenerateCode, no generator found", func(t *testing.T) {
|
||||
result, err := server.GenerateCode(ctx, &CodeGenerateRequest{
|
||||
Generator: "fake",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, result.Success)
|
||||
})
|
||||
|
||||
t.Run("GenerateCode, no TestCase found", func(t *testing.T) {
|
||||
result, err := server.GenerateCode(ctx, &CodeGenerateRequest{
|
||||
Generator: "golang",
|
||||
TestSuite: "fake",
|
||||
TestCase: "fake",
|
||||
})
|
||||
assert.Error(t, err)
|
||||
assert.NotNil(t, result)
|
||||
})
|
||||
|
||||
t.Run("GenerateCode, normal", func(t *testing.T) {
|
||||
// create a new suite
|
||||
_, err := server.CreateTestSuite(ctx, &TestSuiteIdentity{Name: "fake"})
|
||||
assert.NoError(t, err)
|
||||
|
||||
_, err = server.CreateTestCase(ctx, &TestCaseWithSuite{
|
||||
SuiteName: "fake",
|
||||
Data: &TestCase{
|
||||
Name: "fake",
|
||||
},
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
result, err := server.GenerateCode(ctx, &CodeGenerateRequest{
|
||||
Generator: "golang",
|
||||
TestSuite: "fake",
|
||||
TestCase: "fake",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, result)
|
||||
assert.True(t, result.Success)
|
||||
assert.NotEmpty(t, result.Message)
|
||||
})
|
||||
}
|
||||
|
||||
func TestFunctionsQueryStream(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
server := getRemoteServerInTempDir()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v4.23.2
|
||||
// protoc v4.22.2
|
||||
// source: pkg/server/server.proto
|
||||
|
||||
package server
|
||||
|
@ -1492,6 +1492,163 @@ func (x *CommonResult) GetMessage() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
type SimpleList struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Data []*Pair `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SimpleList) Reset() {
|
||||
*x = SimpleList{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[24]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SimpleList) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SimpleList) ProtoMessage() {}
|
||||
|
||||
func (x *SimpleList) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[24]
|
||||
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 SimpleList.ProtoReflect.Descriptor instead.
|
||||
func (*SimpleList) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_server_server_proto_rawDescGZIP(), []int{24}
|
||||
}
|
||||
|
||||
func (x *SimpleList) GetData() []*Pair {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SimpleName struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SimpleName) Reset() {
|
||||
*x = SimpleName{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[25]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SimpleName) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SimpleName) ProtoMessage() {}
|
||||
|
||||
func (x *SimpleName) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[25]
|
||||
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 SimpleName.ProtoReflect.Descriptor instead.
|
||||
func (*SimpleName) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_server_server_proto_rawDescGZIP(), []int{25}
|
||||
}
|
||||
|
||||
func (x *SimpleName) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CodeGenerateRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TestSuite string `protobuf:"bytes,1,opt,name=TestSuite,proto3" json:"TestSuite,omitempty"`
|
||||
TestCase string `protobuf:"bytes,2,opt,name=TestCase,proto3" json:"TestCase,omitempty"`
|
||||
Generator string `protobuf:"bytes,3,opt,name=Generator,proto3" json:"Generator,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CodeGenerateRequest) Reset() {
|
||||
*x = CodeGenerateRequest{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[26]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CodeGenerateRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CodeGenerateRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CodeGenerateRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[26]
|
||||
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 CodeGenerateRequest.ProtoReflect.Descriptor instead.
|
||||
func (*CodeGenerateRequest) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_server_server_proto_rawDescGZIP(), []int{26}
|
||||
}
|
||||
|
||||
func (x *CodeGenerateRequest) GetTestSuite() string {
|
||||
if x != nil {
|
||||
return x.TestSuite
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CodeGenerateRequest) GetTestCase() string {
|
||||
if x != nil {
|
||||
return x.TestCase
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CodeGenerateRequest) GetGenerator() string {
|
||||
if x != nil {
|
||||
return x.Generator
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type Empty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
|
@ -1501,7 +1658,7 @@ type Empty struct {
|
|||
func (x *Empty) Reset() {
|
||||
*x = Empty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[24]
|
||||
mi := &file_pkg_server_server_proto_msgTypes[27]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
@ -1514,7 +1671,7 @@ func (x *Empty) String() string {
|
|||
func (*Empty) ProtoMessage() {}
|
||||
|
||||
func (x *Empty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_pkg_server_server_proto_msgTypes[24]
|
||||
mi := &file_pkg_server_server_proto_msgTypes[27]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
|
@ -1527,7 +1684,7 @@ func (x *Empty) ProtoReflect() protoreflect.Message {
|
|||
|
||||
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
|
||||
func (*Empty) Descriptor() ([]byte, []int) {
|
||||
return file_pkg_server_server_proto_rawDescGZIP(), []int{24}
|
||||
return file_pkg_server_server_proto_rawDescGZIP(), []int{27}
|
||||
}
|
||||
|
||||
var File_pkg_server_server_proto protoreflect.FileDescriptor
|
||||
|
@ -1682,59 +1839,79 @@ var file_pkg_server_server_proto_rawDesc = []byte{
|
|||
0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a,
|
||||
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
||||
0x32, 0xbd, 0x0a, 0x0a, 0x06, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x03, 0x52,
|
||||
0x75, 0x6e, 0x12, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74,
|
||||
0x54, 0x61, 0x73, 0x6b, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65,
|
||||
0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x09, 0x47, 0x65,
|
||||
0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||
0x53, 0x75, 0x69, 0x74, 0x65, 0x73, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61,
|
||||
0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x65,
|
||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64,
|
||||
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0c,
|
||||
0x47, 0x65, 0x74, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x73,
|
||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2e, 0x0a, 0x0a, 0x53, 0x69, 0x6d, 0x70, 0x6c,
|
||||
0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20,
|
||||
0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x69,
|
||||
0x72, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x20, 0x0a, 0x0a, 0x53, 0x69, 0x6d, 0x70, 0x6c,
|
||||
0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x6d, 0x0a, 0x13, 0x43, 0x6f, 0x64,
|
||||
0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x12, 0x1c, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x09, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x1a,
|
||||
0x0a, 0x08, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x08, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x47, 0x65,
|
||||
0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x47,
|
||||
0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74,
|
||||
0x79, 0x32, 0xbc, 0x0b, 0x0a, 0x06, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x03,
|
||||
0x52, 0x75, 0x6e, 0x12, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73,
|
||||
0x74, 0x54, 0x61, 0x73, 0x6b, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54,
|
||||
0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x2c, 0x0a, 0x09, 0x47,
|
||||
0x65, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x53, 0x75, 0x69, 0x74, 0x65, 0x73, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0f, 0x43, 0x72, 0x65,
|
||||
0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x49,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0f,
|
||||
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12,
|
||||
0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69,
|
||||
0x74, 0x65, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c,
|
||||
0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65,
|
||||
0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x65,
|
||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x49, 0x64,
|
||||
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x0c,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x19, 0x2e, 0x73,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a,
|
||||
0x0c, 0x47, 0x65, 0x74, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x19, 0x2e,
|
||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65,
|
||||
0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a,
|
||||
0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65,
|
||||
0x12, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75,
|
||||
0x69, 0x74, 0x65, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c,
|
||||
0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0f, 0x44, 0x65, 0x6c,
|
||||
0x65, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x49,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x53, 0x75, 0x69, 0x74, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53,
|
||||
0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x50, 0x49, 0x73, 0x12, 0x19, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x49,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0b,
|
||||
0x52, 0x75, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x65,
|
||||
0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65,
|
||||
0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54,
|
||||
0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12,
|
||||
0x3b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x18,
|
||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65,
|
||||
0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0e,
|
||||
0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x19,
|
||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65,
|
||||
0x57, 0x69, 0x74, 0x68, 0x53, 0x75, 0x69, 0x74, 0x65, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76,
|
||||
0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12,
|
||||
0x41, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73,
|
||||
0x65, 0x12, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43,
|
||||
0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x75, 0x69, 0x74, 0x65, 0x1a, 0x12, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79,
|
||||
0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74,
|
||||
0x43, 0x61, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65,
|
||||
0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x12,
|
||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70,
|
||||
0x6c, 0x79, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x0e, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x48,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
|
||||
0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3a, 0x0a,
|
||||
0x0c, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x19, 0x2e,
|
||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65,
|
||||
0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x2e, 0x53, 0x75, 0x69, 0x74, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x10, 0x47, 0x65, 0x74,
|
||||
0x53, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x65, 0x64, 0x41, 0x50, 0x49, 0x73, 0x12, 0x19, 0x2e,
|
||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65,
|
||||
0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
|
||||
0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a,
|
||||
0x0b, 0x52, 0x75, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x49, 0x64,
|
||||
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||
0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00,
|
||||
0x12, 0x3b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12,
|
||||
0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73,
|
||||
0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76,
|
||||
0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a,
|
||||
0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x12,
|
||||
0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61, 0x73,
|
||||
0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x75, 0x69, 0x74, 0x65, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72,
|
||||
0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00,
|
||||
0x12, 0x41, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x65, 0x73, 0x74, 0x43, 0x61,
|
||||
0x73, 0x65, 0x12, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54, 0x65, 0x73, 0x74,
|
||||
0x43, 0x61, 0x73, 0x65, 0x57, 0x69, 0x74, 0x68, 0x53, 0x75, 0x69, 0x74, 0x65, 0x1a, 0x12, 0x2e,
|
||||
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c,
|
||||
0x79, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x73,
|
||||
0x74, 0x43, 0x61, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x54,
|
||||
0x65, 0x73, 0x74, 0x43, 0x61, 0x73, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a,
|
||||
0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65,
|
||||
0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64,
|
||||
0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x0d, 0x2e, 0x73, 0x65, 0x72,
|
||||
0x76, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76,
|
||||
0x65, 0x72, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x00, 0x12,
|
||||
0x43, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e,
|
||||
0x65, 0x72, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x73,
|
||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75,
|
||||
0x6c, 0x74, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x0e, 0x50, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x48,
|
||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e,
|
||||
0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x50,
|
||||
0x61, 0x69, 0x72, 0x73, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x0e, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69,
|
||||
|
@ -1785,41 +1962,44 @@ func file_pkg_server_server_proto_rawDescGZIP() []byte {
|
|||
return file_pkg_server_server_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_pkg_server_server_proto_msgTypes = make([]protoimpl.MessageInfo, 27)
|
||||
var file_pkg_server_server_proto_msgTypes = make([]protoimpl.MessageInfo, 30)
|
||||
var file_pkg_server_server_proto_goTypes = []interface{}{
|
||||
(*Suites)(nil), // 0: server.Suites
|
||||
(*Items)(nil), // 1: server.Items
|
||||
(*TestCaseIdentity)(nil), // 2: server.TestCaseIdentity
|
||||
(*TestSuite)(nil), // 3: server.TestSuite
|
||||
(*APISpec)(nil), // 4: server.APISpec
|
||||
(*TestSuiteIdentity)(nil), // 5: server.TestSuiteIdentity
|
||||
(*TestTask)(nil), // 6: server.TestTask
|
||||
(*TestResult)(nil), // 7: server.TestResult
|
||||
(*HelloReply)(nil), // 8: server.HelloReply
|
||||
(*Suite)(nil), // 9: server.Suite
|
||||
(*TestCaseWithSuite)(nil), // 10: server.TestCaseWithSuite
|
||||
(*TestCases)(nil), // 11: server.TestCases
|
||||
(*TestCase)(nil), // 12: server.TestCase
|
||||
(*Request)(nil), // 13: server.Request
|
||||
(*Response)(nil), // 14: server.Response
|
||||
(*TestCaseResult)(nil), // 15: server.TestCaseResult
|
||||
(*Pair)(nil), // 16: server.Pair
|
||||
(*Pairs)(nil), // 17: server.Pairs
|
||||
(*SimpleQuery)(nil), // 18: server.SimpleQuery
|
||||
(*Stores)(nil), // 19: server.Stores
|
||||
(*Store)(nil), // 20: server.Store
|
||||
(*StoreKinds)(nil), // 21: server.StoreKinds
|
||||
(*StoreKind)(nil), // 22: server.StoreKind
|
||||
(*CommonResult)(nil), // 23: server.CommonResult
|
||||
(*Empty)(nil), // 24: server.Empty
|
||||
nil, // 25: server.Suites.DataEntry
|
||||
nil, // 26: server.TestTask.EnvEntry
|
||||
(*Suites)(nil), // 0: server.Suites
|
||||
(*Items)(nil), // 1: server.Items
|
||||
(*TestCaseIdentity)(nil), // 2: server.TestCaseIdentity
|
||||
(*TestSuite)(nil), // 3: server.TestSuite
|
||||
(*APISpec)(nil), // 4: server.APISpec
|
||||
(*TestSuiteIdentity)(nil), // 5: server.TestSuiteIdentity
|
||||
(*TestTask)(nil), // 6: server.TestTask
|
||||
(*TestResult)(nil), // 7: server.TestResult
|
||||
(*HelloReply)(nil), // 8: server.HelloReply
|
||||
(*Suite)(nil), // 9: server.Suite
|
||||
(*TestCaseWithSuite)(nil), // 10: server.TestCaseWithSuite
|
||||
(*TestCases)(nil), // 11: server.TestCases
|
||||
(*TestCase)(nil), // 12: server.TestCase
|
||||
(*Request)(nil), // 13: server.Request
|
||||
(*Response)(nil), // 14: server.Response
|
||||
(*TestCaseResult)(nil), // 15: server.TestCaseResult
|
||||
(*Pair)(nil), // 16: server.Pair
|
||||
(*Pairs)(nil), // 17: server.Pairs
|
||||
(*SimpleQuery)(nil), // 18: server.SimpleQuery
|
||||
(*Stores)(nil), // 19: server.Stores
|
||||
(*Store)(nil), // 20: server.Store
|
||||
(*StoreKinds)(nil), // 21: server.StoreKinds
|
||||
(*StoreKind)(nil), // 22: server.StoreKind
|
||||
(*CommonResult)(nil), // 23: server.CommonResult
|
||||
(*SimpleList)(nil), // 24: server.SimpleList
|
||||
(*SimpleName)(nil), // 25: server.SimpleName
|
||||
(*CodeGenerateRequest)(nil), // 26: server.CodeGenerateRequest
|
||||
(*Empty)(nil), // 27: server.Empty
|
||||
nil, // 28: server.Suites.DataEntry
|
||||
nil, // 29: server.TestTask.EnvEntry
|
||||
}
|
||||
var file_pkg_server_server_proto_depIdxs = []int32{
|
||||
25, // 0: server.Suites.data:type_name -> server.Suites.DataEntry
|
||||
28, // 0: server.Suites.data:type_name -> server.Suites.DataEntry
|
||||
16, // 1: server.TestSuite.param:type_name -> server.Pair
|
||||
4, // 2: server.TestSuite.spec:type_name -> server.APISpec
|
||||
26, // 3: server.TestTask.env:type_name -> server.TestTask.EnvEntry
|
||||
29, // 3: server.TestTask.env:type_name -> server.TestTask.EnvEntry
|
||||
15, // 4: server.TestResult.testCaseResult:type_name -> server.TestCaseResult
|
||||
12, // 5: server.Suite.items:type_name -> server.TestCase
|
||||
12, // 6: server.TestCaseWithSuite.data:type_name -> server.TestCase
|
||||
|
@ -1837,58 +2017,63 @@ var file_pkg_server_server_proto_depIdxs = []int32{
|
|||
16, // 18: server.Store.properties:type_name -> server.Pair
|
||||
22, // 19: server.Store.kind:type_name -> server.StoreKind
|
||||
22, // 20: server.StoreKinds.data:type_name -> server.StoreKind
|
||||
1, // 21: server.Suites.DataEntry.value:type_name -> server.Items
|
||||
6, // 22: server.Runner.Run:input_type -> server.TestTask
|
||||
24, // 23: server.Runner.GetSuites:input_type -> server.Empty
|
||||
5, // 24: server.Runner.CreateTestSuite:input_type -> server.TestSuiteIdentity
|
||||
5, // 25: server.Runner.GetTestSuite:input_type -> server.TestSuiteIdentity
|
||||
3, // 26: server.Runner.UpdateTestSuite:input_type -> server.TestSuite
|
||||
5, // 27: server.Runner.DeleteTestSuite:input_type -> server.TestSuiteIdentity
|
||||
5, // 28: server.Runner.ListTestCase:input_type -> server.TestSuiteIdentity
|
||||
5, // 29: server.Runner.GetSuggestedAPIs:input_type -> server.TestSuiteIdentity
|
||||
2, // 30: server.Runner.RunTestCase:input_type -> server.TestCaseIdentity
|
||||
2, // 31: server.Runner.GetTestCase:input_type -> server.TestCaseIdentity
|
||||
10, // 32: server.Runner.CreateTestCase:input_type -> server.TestCaseWithSuite
|
||||
10, // 33: server.Runner.UpdateTestCase:input_type -> server.TestCaseWithSuite
|
||||
2, // 34: server.Runner.DeleteTestCase:input_type -> server.TestCaseIdentity
|
||||
24, // 35: server.Runner.PopularHeaders:input_type -> server.Empty
|
||||
18, // 36: server.Runner.FunctionsQuery:input_type -> server.SimpleQuery
|
||||
18, // 37: server.Runner.FunctionsQueryStream:input_type -> server.SimpleQuery
|
||||
24, // 38: server.Runner.GetVersion:input_type -> server.Empty
|
||||
24, // 39: server.Runner.Sample:input_type -> server.Empty
|
||||
24, // 40: server.Runner.GetStoreKinds:input_type -> server.Empty
|
||||
24, // 41: server.Runner.GetStores:input_type -> server.Empty
|
||||
20, // 42: server.Runner.CreateStore:input_type -> server.Store
|
||||
20, // 43: server.Runner.DeleteStore:input_type -> server.Store
|
||||
18, // 44: server.Runner.VerifyStore:input_type -> server.SimpleQuery
|
||||
7, // 45: server.Runner.Run:output_type -> server.TestResult
|
||||
0, // 46: server.Runner.GetSuites:output_type -> server.Suites
|
||||
8, // 47: server.Runner.CreateTestSuite:output_type -> server.HelloReply
|
||||
3, // 48: server.Runner.GetTestSuite:output_type -> server.TestSuite
|
||||
8, // 49: server.Runner.UpdateTestSuite:output_type -> server.HelloReply
|
||||
8, // 50: server.Runner.DeleteTestSuite:output_type -> server.HelloReply
|
||||
9, // 51: server.Runner.ListTestCase:output_type -> server.Suite
|
||||
11, // 52: server.Runner.GetSuggestedAPIs:output_type -> server.TestCases
|
||||
15, // 53: server.Runner.RunTestCase:output_type -> server.TestCaseResult
|
||||
12, // 54: server.Runner.GetTestCase:output_type -> server.TestCase
|
||||
8, // 55: server.Runner.CreateTestCase:output_type -> server.HelloReply
|
||||
8, // 56: server.Runner.UpdateTestCase:output_type -> server.HelloReply
|
||||
8, // 57: server.Runner.DeleteTestCase:output_type -> server.HelloReply
|
||||
17, // 58: server.Runner.PopularHeaders:output_type -> server.Pairs
|
||||
17, // 59: server.Runner.FunctionsQuery:output_type -> server.Pairs
|
||||
17, // 60: server.Runner.FunctionsQueryStream:output_type -> server.Pairs
|
||||
8, // 61: server.Runner.GetVersion:output_type -> server.HelloReply
|
||||
8, // 62: server.Runner.Sample:output_type -> server.HelloReply
|
||||
21, // 63: server.Runner.GetStoreKinds:output_type -> server.StoreKinds
|
||||
19, // 64: server.Runner.GetStores:output_type -> server.Stores
|
||||
20, // 65: server.Runner.CreateStore:output_type -> server.Store
|
||||
20, // 66: server.Runner.DeleteStore:output_type -> server.Store
|
||||
23, // 67: server.Runner.VerifyStore:output_type -> server.CommonResult
|
||||
45, // [45:68] is the sub-list for method output_type
|
||||
22, // [22:45] is the sub-list for method input_type
|
||||
22, // [22:22] is the sub-list for extension type_name
|
||||
22, // [22:22] is the sub-list for extension extendee
|
||||
0, // [0:22] is the sub-list for field type_name
|
||||
16, // 21: server.SimpleList.data:type_name -> server.Pair
|
||||
1, // 22: server.Suites.DataEntry.value:type_name -> server.Items
|
||||
6, // 23: server.Runner.Run:input_type -> server.TestTask
|
||||
27, // 24: server.Runner.GetSuites:input_type -> server.Empty
|
||||
5, // 25: server.Runner.CreateTestSuite:input_type -> server.TestSuiteIdentity
|
||||
5, // 26: server.Runner.GetTestSuite:input_type -> server.TestSuiteIdentity
|
||||
3, // 27: server.Runner.UpdateTestSuite:input_type -> server.TestSuite
|
||||
5, // 28: server.Runner.DeleteTestSuite:input_type -> server.TestSuiteIdentity
|
||||
5, // 29: server.Runner.ListTestCase:input_type -> server.TestSuiteIdentity
|
||||
5, // 30: server.Runner.GetSuggestedAPIs:input_type -> server.TestSuiteIdentity
|
||||
2, // 31: server.Runner.RunTestCase:input_type -> server.TestCaseIdentity
|
||||
2, // 32: server.Runner.GetTestCase:input_type -> server.TestCaseIdentity
|
||||
10, // 33: server.Runner.CreateTestCase:input_type -> server.TestCaseWithSuite
|
||||
10, // 34: server.Runner.UpdateTestCase:input_type -> server.TestCaseWithSuite
|
||||
2, // 35: server.Runner.DeleteTestCase:input_type -> server.TestCaseIdentity
|
||||
27, // 36: server.Runner.ListCodeGenerator:input_type -> server.Empty
|
||||
26, // 37: server.Runner.GenerateCode:input_type -> server.CodeGenerateRequest
|
||||
27, // 38: server.Runner.PopularHeaders:input_type -> server.Empty
|
||||
18, // 39: server.Runner.FunctionsQuery:input_type -> server.SimpleQuery
|
||||
18, // 40: server.Runner.FunctionsQueryStream:input_type -> server.SimpleQuery
|
||||
27, // 41: server.Runner.GetVersion:input_type -> server.Empty
|
||||
27, // 42: server.Runner.Sample:input_type -> server.Empty
|
||||
27, // 43: server.Runner.GetStoreKinds:input_type -> server.Empty
|
||||
27, // 44: server.Runner.GetStores:input_type -> server.Empty
|
||||
20, // 45: server.Runner.CreateStore:input_type -> server.Store
|
||||
20, // 46: server.Runner.DeleteStore:input_type -> server.Store
|
||||
18, // 47: server.Runner.VerifyStore:input_type -> server.SimpleQuery
|
||||
7, // 48: server.Runner.Run:output_type -> server.TestResult
|
||||
0, // 49: server.Runner.GetSuites:output_type -> server.Suites
|
||||
8, // 50: server.Runner.CreateTestSuite:output_type -> server.HelloReply
|
||||
3, // 51: server.Runner.GetTestSuite:output_type -> server.TestSuite
|
||||
8, // 52: server.Runner.UpdateTestSuite:output_type -> server.HelloReply
|
||||
8, // 53: server.Runner.DeleteTestSuite:output_type -> server.HelloReply
|
||||
9, // 54: server.Runner.ListTestCase:output_type -> server.Suite
|
||||
11, // 55: server.Runner.GetSuggestedAPIs:output_type -> server.TestCases
|
||||
15, // 56: server.Runner.RunTestCase:output_type -> server.TestCaseResult
|
||||
12, // 57: server.Runner.GetTestCase:output_type -> server.TestCase
|
||||
8, // 58: server.Runner.CreateTestCase:output_type -> server.HelloReply
|
||||
8, // 59: server.Runner.UpdateTestCase:output_type -> server.HelloReply
|
||||
8, // 60: server.Runner.DeleteTestCase:output_type -> server.HelloReply
|
||||
24, // 61: server.Runner.ListCodeGenerator:output_type -> server.SimpleList
|
||||
23, // 62: server.Runner.GenerateCode:output_type -> server.CommonResult
|
||||
17, // 63: server.Runner.PopularHeaders:output_type -> server.Pairs
|
||||
17, // 64: server.Runner.FunctionsQuery:output_type -> server.Pairs
|
||||
17, // 65: server.Runner.FunctionsQueryStream:output_type -> server.Pairs
|
||||
8, // 66: server.Runner.GetVersion:output_type -> server.HelloReply
|
||||
8, // 67: server.Runner.Sample:output_type -> server.HelloReply
|
||||
21, // 68: server.Runner.GetStoreKinds:output_type -> server.StoreKinds
|
||||
19, // 69: server.Runner.GetStores:output_type -> server.Stores
|
||||
20, // 70: server.Runner.CreateStore:output_type -> server.Store
|
||||
20, // 71: server.Runner.DeleteStore:output_type -> server.Store
|
||||
23, // 72: server.Runner.VerifyStore:output_type -> server.CommonResult
|
||||
48, // [48:73] is the sub-list for method output_type
|
||||
23, // [23:48] is the sub-list for method input_type
|
||||
23, // [23:23] is the sub-list for extension type_name
|
||||
23, // [23:23] is the sub-list for extension extendee
|
||||
0, // [0:23] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_pkg_server_server_proto_init() }
|
||||
|
@ -2186,6 +2371,42 @@ func file_pkg_server_server_proto_init() {
|
|||
}
|
||||
}
|
||||
file_pkg_server_server_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SimpleList); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pkg_server_server_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SimpleName); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pkg_server_server_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CodeGenerateRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_pkg_server_server_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Empty); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
|
@ -2204,7 +2425,7 @@ func file_pkg_server_server_proto_init() {
|
|||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_pkg_server_server_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 27,
|
||||
NumMessages: 30,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
|
|
|
@ -473,6 +473,74 @@ func local_request_Runner_DeleteTestCase_0(ctx context.Context, marshaler runtim
|
|||
|
||||
}
|
||||
|
||||
func request_Runner_ListCodeGenerator_0(ctx context.Context, marshaler runtime.Marshaler, client RunnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListCodeGenerator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Runner_ListCodeGenerator_0(ctx context.Context, marshaler runtime.Marshaler, server RunnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListCodeGenerator(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Runner_GenerateCode_0(ctx context.Context, marshaler runtime.Marshaler, client RunnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CodeGenerateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GenerateCode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_Runner_GenerateCode_0(ctx context.Context, marshaler runtime.Marshaler, server RunnerServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CodeGenerateRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GenerateCode(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Runner_PopularHeaders_0(ctx context.Context, marshaler runtime.Marshaler, client RunnerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq Empty
|
||||
var metadata runtime.ServerMetadata
|
||||
|
@ -1153,6 +1221,56 @@ func RegisterRunnerHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Runner_ListCodeGenerator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/server.Runner/ListCodeGenerator", runtime.WithHTTPPathPattern("/server.Runner/ListCodeGenerator"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Runner_ListCodeGenerator_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Runner_ListCodeGenerator_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Runner_GenerateCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
var stream runtime.ServerTransportStream
|
||||
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/server.Runner/GenerateCode", runtime.WithHTTPPathPattern("/server.Runner/GenerateCode"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Runner_GenerateCode_0(annotatedContext, inboundMarshaler, server, req, pathParams)
|
||||
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Runner_GenerateCode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Runner_PopularHeaders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
|
@ -1712,6 +1830,50 @@ func RegisterRunnerHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli
|
|||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Runner_ListCodeGenerator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/server.Runner/ListCodeGenerator", runtime.WithHTTPPathPattern("/server.Runner/ListCodeGenerator"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Runner_ListCodeGenerator_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Runner_ListCodeGenerator_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Runner_GenerateCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/server.Runner/GenerateCode", runtime.WithHTTPPathPattern("/server.Runner/GenerateCode"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_Runner_GenerateCode_0(annotatedContext, inboundMarshaler, client, req, pathParams)
|
||||
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Runner_GenerateCode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Runner_PopularHeaders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
|
@ -1962,6 +2124,10 @@ var (
|
|||
|
||||
pattern_Runner_DeleteTestCase_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"server.Runner", "DeleteTestCase"}, ""))
|
||||
|
||||
pattern_Runner_ListCodeGenerator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"server.Runner", "ListCodeGenerator"}, ""))
|
||||
|
||||
pattern_Runner_GenerateCode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"server.Runner", "GenerateCode"}, ""))
|
||||
|
||||
pattern_Runner_PopularHeaders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"server.Runner", "PopularHeaders"}, ""))
|
||||
|
||||
pattern_Runner_FunctionsQuery_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"server.Runner", "FunctionsQuery"}, ""))
|
||||
|
@ -2010,6 +2176,10 @@ var (
|
|||
|
||||
forward_Runner_DeleteTestCase_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Runner_ListCodeGenerator_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Runner_GenerateCode_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Runner_PopularHeaders_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_Runner_FunctionsQuery_0 = runtime.ForwardResponseMessage
|
||||
|
|
|
@ -23,6 +23,10 @@ service Runner {
|
|||
rpc UpdateTestCase(TestCaseWithSuite) returns (HelloReply) {}
|
||||
rpc DeleteTestCase(TestCaseIdentity) returns (HelloReply) {}
|
||||
|
||||
// code generator
|
||||
rpc ListCodeGenerator(Empty) returns (SimpleList) {}
|
||||
rpc GenerateCode(CodeGenerateRequest) returns (CommonResult) {}
|
||||
|
||||
// common services
|
||||
rpc PopularHeaders(Empty) returns (Pairs) {}
|
||||
rpc FunctionsQuery(SimpleQuery) returns (Pairs) {}
|
||||
|
@ -177,5 +181,19 @@ message CommonResult {
|
|||
string message = 2;
|
||||
}
|
||||
|
||||
message SimpleList {
|
||||
repeated Pair data = 1;
|
||||
}
|
||||
|
||||
message SimpleName {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message CodeGenerateRequest {
|
||||
string TestSuite = 1;
|
||||
string TestCase = 2;
|
||||
string Generator = 3;
|
||||
}
|
||||
|
||||
message Empty {
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v4.23.2
|
||||
// - protoc v4.22.2
|
||||
// source: pkg/server/server.proto
|
||||
|
||||
package server
|
||||
|
@ -37,6 +37,9 @@ type RunnerClient interface {
|
|||
CreateTestCase(ctx context.Context, in *TestCaseWithSuite, opts ...grpc.CallOption) (*HelloReply, error)
|
||||
UpdateTestCase(ctx context.Context, in *TestCaseWithSuite, opts ...grpc.CallOption) (*HelloReply, error)
|
||||
DeleteTestCase(ctx context.Context, in *TestCaseIdentity, opts ...grpc.CallOption) (*HelloReply, error)
|
||||
// code generator
|
||||
ListCodeGenerator(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SimpleList, error)
|
||||
GenerateCode(ctx context.Context, in *CodeGenerateRequest, opts ...grpc.CallOption) (*CommonResult, error)
|
||||
// common services
|
||||
PopularHeaders(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Pairs, error)
|
||||
FunctionsQuery(ctx context.Context, in *SimpleQuery, opts ...grpc.CallOption) (*Pairs, error)
|
||||
|
@ -176,6 +179,24 @@ func (c *runnerClient) DeleteTestCase(ctx context.Context, in *TestCaseIdentity,
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *runnerClient) ListCodeGenerator(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SimpleList, error) {
|
||||
out := new(SimpleList)
|
||||
err := c.cc.Invoke(ctx, "/server.Runner/ListCodeGenerator", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *runnerClient) GenerateCode(ctx context.Context, in *CodeGenerateRequest, opts ...grpc.CallOption) (*CommonResult, error) {
|
||||
out := new(CommonResult)
|
||||
err := c.cc.Invoke(ctx, "/server.Runner/GenerateCode", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *runnerClient) PopularHeaders(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Pairs, error) {
|
||||
out := new(Pairs)
|
||||
err := c.cc.Invoke(ctx, "/server.Runner/PopularHeaders", in, out, opts...)
|
||||
|
@ -307,6 +328,9 @@ type RunnerServer interface {
|
|||
CreateTestCase(context.Context, *TestCaseWithSuite) (*HelloReply, error)
|
||||
UpdateTestCase(context.Context, *TestCaseWithSuite) (*HelloReply, error)
|
||||
DeleteTestCase(context.Context, *TestCaseIdentity) (*HelloReply, error)
|
||||
// code generator
|
||||
ListCodeGenerator(context.Context, *Empty) (*SimpleList, error)
|
||||
GenerateCode(context.Context, *CodeGenerateRequest) (*CommonResult, error)
|
||||
// common services
|
||||
PopularHeaders(context.Context, *Empty) (*Pairs, error)
|
||||
FunctionsQuery(context.Context, *SimpleQuery) (*Pairs, error)
|
||||
|
@ -365,6 +389,12 @@ func (UnimplementedRunnerServer) UpdateTestCase(context.Context, *TestCaseWithSu
|
|||
func (UnimplementedRunnerServer) DeleteTestCase(context.Context, *TestCaseIdentity) (*HelloReply, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteTestCase not implemented")
|
||||
}
|
||||
func (UnimplementedRunnerServer) ListCodeGenerator(context.Context, *Empty) (*SimpleList, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListCodeGenerator not implemented")
|
||||
}
|
||||
func (UnimplementedRunnerServer) GenerateCode(context.Context, *CodeGenerateRequest) (*CommonResult, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GenerateCode not implemented")
|
||||
}
|
||||
func (UnimplementedRunnerServer) PopularHeaders(context.Context, *Empty) (*Pairs, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PopularHeaders not implemented")
|
||||
}
|
||||
|
@ -642,6 +672,42 @@ func _Runner_DeleteTestCase_Handler(srv interface{}, ctx context.Context, dec fu
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Runner_ListCodeGenerator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RunnerServer).ListCodeGenerator(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/server.Runner/ListCodeGenerator",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RunnerServer).ListCodeGenerator(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Runner_GenerateCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CodeGenerateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RunnerServer).GenerateCode(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/server.Runner/GenerateCode",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RunnerServer).GenerateCode(ctx, req.(*CodeGenerateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Runner_PopularHeaders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
|
@ -889,6 +955,14 @@ var Runner_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "DeleteTestCase",
|
||||
Handler: _Runner_DeleteTestCase_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListCodeGenerator",
|
||||
Handler: _Runner_ListCodeGenerator_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GenerateCode",
|
||||
Handler: _Runner_GenerateCode_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PopularHeaders",
|
||||
Handler: _Runner_PopularHeaders_Handler,
|
||||
|
|
Loading…
Reference in New Issue