options.go raw

   1  // Copyright 2019 The Go Authors. All rights reserved.
   2  // Use of this source code is governed by a BSD-style
   3  // license that can be found in the LICENSE file.
   4  
   5  // Package descopts contains the nil pointers to concrete descriptor options.
   6  //
   7  // This package exists as a form of reverse dependency injection so that certain
   8  // packages (e.g., internal/filedesc and internal/filetype can avoid a direct
   9  // dependency on the descriptor proto package).
  10  package descopts
  11  
  12  import "google.golang.org/protobuf/reflect/protoreflect"
  13  
  14  // These variables are set by the init function in descriptor.pb.go via logic
  15  // in internal/filetype. In other words, so long as the descriptor proto package
  16  // is linked in, these variables will be populated.
  17  //
  18  // Each variable is populated with a nil pointer to the options struct.
  19  var (
  20  	File           protoreflect.ProtoMessage
  21  	Enum           protoreflect.ProtoMessage
  22  	EnumValue      protoreflect.ProtoMessage
  23  	Message        protoreflect.ProtoMessage
  24  	Field          protoreflect.ProtoMessage
  25  	Oneof          protoreflect.ProtoMessage
  26  	ExtensionRange protoreflect.ProtoMessage
  27  	Service        protoreflect.ProtoMessage
  28  	Method         protoreflect.ProtoMessage
  29  )
  30