~bigbes/tarantool

tarantool-protobuf

ref: a2f1209d39dd42c812e515369ed21e39430048fb tarantool-protobuf/cmd/protoc-gen-tarantool/internal/gen/options.go -rw-r--r-- 1.0 KiB
a2f1209d — Eugene Blikh json: drop unrecognized enum string names per proto3 spec 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
}