~bigbes/tarantool

tarantool-protobuf

ref: 37c56322536a2a0b1c8c79d9e531f613795ccba1 tarantool-protobuf/cmd/protoc-gen-tarantool/internal/gen/options.go -rw-r--r-- 1.0 KiB
37c56322 — Eugene Blikh json: enable conformance JSON output + close 459 tests 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package gen

import (
	"google.golang.org/protobuf/proto"
	"google.golang.org/protobuf/reflect/protoreflect"
	"google.golang.org/protobuf/runtime/protoimpl"
	"google.golang.org/protobuf/types/descriptorpb"
)

// E_LuaPackage mirrors the option declared in options/tarantool/tarantool.proto.
// We register it manually here to avoid having to ship a generated stub for our
// own option file.
var E_LuaPackage = &protoimpl.ExtensionInfo{
	ExtendedType:  (*descriptorpb.FileOptions)(nil),
	ExtensionType: (*string)(nil),
	Field:         60001,
	Name:          "tarantool.lua_package",
	Tag:           "bytes,60001,opt,name=lua_package",
	Filename:      "tarantool/tarantool.proto",
}

// luaPackageOption returns the value of (tarantool.lua_package) on the file
// options, or "" when unset.
func luaPackageOption(f protoreflect.FileDescriptor) string {
	opts, _ := f.Options().(*descriptorpb.FileOptions)
	if opts == nil {
		return ""
	}
	v, ok := proto.GetExtension(opts, E_LuaPackage).(string)
	if !ok {
		return ""
	}
	return v
}