1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-26 12:07:47 -05:00
v2fly/infra/conf/v2jsonpb/any2.go

32 lines
896 B
Go
Raw Normal View History

2021-06-19 15:20:31 -04:00
package v2jsonpb
import (
"github.com/golang/protobuf/jsonpb"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
)
type anyresolverv2 struct {
2021-06-19 15:20:31 -04:00
backgroundResolver jsonpb.AnyResolver
}
func (r anyresolverv2) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {
2021-06-19 15:20:31 -04:00
panic("implement me")
}
func (r anyresolverv2) FindMessageByURL(url string) (protoreflect.MessageType, error) {
2021-06-19 15:20:31 -04:00
msg, err := r.backgroundResolver.Resolve(url)
if err != nil {
return nil, err
}
return msg.(proto.Message).ProtoReflect().Type(), nil
}
func (r anyresolverv2) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {
2021-06-19 15:20:31 -04:00
panic("implement me")
}
func (r anyresolverv2) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {
2021-06-19 15:20:31 -04:00
panic("implement me")
}