github.com/imannamdari/v2ray-core/v5@v5.0.5/infra/conf/v2jsonpb/any2.go (about)

     1  package v2jsonpb
     2  
     3  import (
     4  	"github.com/golang/protobuf/jsonpb"
     5  	"google.golang.org/protobuf/proto"
     6  	"google.golang.org/protobuf/reflect/protoreflect"
     7  )
     8  
     9  type anyresolverv2 struct {
    10  	backgroundResolver jsonpb.AnyResolver
    11  }
    12  
    13  func (r anyresolverv2) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {
    14  	panic("implement me")
    15  }
    16  
    17  func (r anyresolverv2) FindMessageByURL(url string) (protoreflect.MessageType, error) {
    18  	msg, err := r.backgroundResolver.Resolve(url)
    19  	if err != nil {
    20  		return nil, err
    21  	}
    22  	return msg.(proto.Message).ProtoReflect().Type(), nil
    23  }
    24  
    25  func (r anyresolverv2) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {
    26  	panic("implement me")
    27  }
    28  
    29  func (r anyresolverv2) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {
    30  	panic("implement me")
    31  }