Compare commits
4 Commits
dev/moul/m
...
renovate/a
Author | SHA1 | Date | |
---|---|---|---|
|
8639ff85f4 | ||
|
c60433e6c9 | ||
|
b6eb434519 | ||
|
5c194ed5b8 |
@@ -8,12 +8,12 @@
|
|||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-animate.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular-animate.js"></script>
|
||||||
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.3.js"></script>
|
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.3.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.3/ui-bootstrap.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.14.3/ui-bootstrap.min.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.min.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.min.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-protobuf.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/mode-protobuf.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/mode-golang.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/mode-golang.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/theme-cobalt.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/theme-cobalt.js"></script>
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/worker-javascript.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/worker-javascript.js"></script>
|
||||||
<script src="//angular-ui.github.io/ui-ace/dist/ui-ace.min.js"></script>
|
<script src="//angular-ui.github.io/ui-ace/dist/ui-ace.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
12
go.mod
generated
12
go.mod
generated
@@ -5,17 +5,17 @@ require (
|
|||||||
github.com/Masterminds/semver v1.5.0 // indirect
|
github.com/Masterminds/semver v1.5.0 // indirect
|
||||||
github.com/Masterminds/sprig v2.22.0+incompatible
|
github.com/Masterminds/sprig v2.22.0+incompatible
|
||||||
github.com/gobuffalo/packr/v2 v2.8.0
|
github.com/gobuffalo/packr/v2 v2.8.0
|
||||||
github.com/golang/protobuf v1.3.2
|
github.com/golang/protobuf v1.4.2
|
||||||
github.com/google/uuid v1.1.1 // indirect
|
github.com/google/uuid v1.1.1 // indirect
|
||||||
github.com/gorilla/handlers v1.4.2
|
github.com/gorilla/handlers v1.5.1
|
||||||
github.com/gorilla/mux v1.7.3
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.12.1
|
github.com/grpc-ecosystem/grpc-gateway v1.15.2
|
||||||
github.com/huandu/xstrings v1.3.0
|
github.com/huandu/xstrings v1.3.2
|
||||||
github.com/imdario/mergo v0.3.8 // indirect
|
github.com/imdario/mergo v0.3.8 // indirect
|
||||||
github.com/mitchellh/copystructure v1.0.0 // indirect
|
github.com/mitchellh/copystructure v1.0.0 // indirect
|
||||||
github.com/mitchellh/reflectwalk v1.0.1 // indirect
|
github.com/mitchellh/reflectwalk v1.0.1 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d // indirect
|
golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d // indirect
|
||||||
google.golang.org/genproto v0.0.0-20200113173426-e1de0a7b01eb
|
google.golang.org/genproto 4d944d34d83c
|
||||||
gopkg.in/yaml.v2 v2.2.7 // indirect
|
gopkg.in/yaml.v2 v2.2.7 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -163,6 +163,8 @@ var ProtoHelpersFuncMap = template.FuncMap{
|
|||||||
"getStore": getStore,
|
"getStore": getStore,
|
||||||
"goPkg": goPkg,
|
"goPkg": goPkg,
|
||||||
"goPkgLastElement": goPkgLastElement,
|
"goPkgLastElement": goPkgLastElement,
|
||||||
|
"cppType": cppType,
|
||||||
|
"cppTypeWithPackage": cppTypeWithPackage,
|
||||||
}
|
}
|
||||||
|
|
||||||
var pathMap map[interface{}]*descriptor.SourceCodeInfo_Location
|
var pathMap map[interface{}]*descriptor.SourceCodeInfo_Location
|
||||||
@@ -909,6 +911,57 @@ func haskellType(pkg string, f *descriptor.FieldDescriptorProto) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warning does not handle message embedded like goTypeWithGoPackage does.
|
||||||
|
func cppTypeWithPackage(f *descriptor.FieldDescriptorProto) string {
|
||||||
|
pkg := ""
|
||||||
|
if *f.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE || *f.Type == descriptor.FieldDescriptorProto_TYPE_ENUM {
|
||||||
|
if isTimestampPackage(*f.TypeName) {
|
||||||
|
pkg = "timestamp"
|
||||||
|
} else {
|
||||||
|
pkg = getPackageTypeName(*f.TypeName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cppType(pkg, f)
|
||||||
|
}
|
||||||
|
|
||||||
|
func cppType(pkg string, f *descriptor.FieldDescriptorProto) string {
|
||||||
|
isRepeat := *f.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED
|
||||||
|
typeName := "???"
|
||||||
|
switch *f.Type {
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
|
||||||
|
typeName = "double"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_FLOAT:
|
||||||
|
typeName = "float"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_INT64:
|
||||||
|
typeName = "int64_t"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_UINT64:
|
||||||
|
typeName = "uint64_t"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_INT32:
|
||||||
|
typeName = "int32_t"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_UINT32:
|
||||||
|
typeName = "uint32_t"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_BOOL:
|
||||||
|
typeName = "bool"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_STRING:
|
||||||
|
typeName = "std::string"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
|
||||||
|
if pkg != "" {
|
||||||
|
pkg = pkg + "."
|
||||||
|
}
|
||||||
|
typeName = fmt.Sprintf("%s%s", pkg, shortType(*f.TypeName))
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_BYTES:
|
||||||
|
typeName = "std::vector<uint8_t>"
|
||||||
|
case descriptor.FieldDescriptorProto_TYPE_ENUM:
|
||||||
|
typeName = fmt.Sprintf("%s%s", pkg, shortType(*f.TypeName))
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
if isRepeat {
|
||||||
|
return "std::vector<" + typeName + ">"
|
||||||
|
}
|
||||||
|
return typeName
|
||||||
|
}
|
||||||
|
|
||||||
func goTypeWithEmbedded(pkg string, f *descriptor.FieldDescriptorProto, p *descriptor.FileDescriptorProto) string {
|
func goTypeWithEmbedded(pkg string, f *descriptor.FieldDescriptorProto, p *descriptor.FileDescriptorProto) string {
|
||||||
if pkg != "" {
|
if pkg != "" {
|
||||||
pkg = pkg + "."
|
pkg = pkg + "."
|
||||||
|
Reference in New Issue
Block a user