options.go 1.1 KB

1234567891011121314151617181920212223242526272829
  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. // Package descopts contains the nil pointers to concrete descriptor options.
  5. //
  6. // This package exists as a form of reverse dependency injection so that certain
  7. // packages (e.g., internal/filedesc and internal/filetype can avoid a direct
  8. // dependency on the descriptor proto package).
  9. package descopts
  10. import pref "google.golang.org/protobuf/reflect/protoreflect"
  11. // These variables are set by the init function in descriptor.pb.go via logic
  12. // in internal/filetype. In other words, so long as the descriptor proto package
  13. // is linked in, these variables will be populated.
  14. //
  15. // Each variable is populated with a nil pointer to the options struct.
  16. var (
  17. File pref.ProtoMessage
  18. Enum pref.ProtoMessage
  19. EnumValue pref.ProtoMessage
  20. Message pref.ProtoMessage
  21. Field pref.ProtoMessage
  22. Oneof pref.ProtoMessage
  23. ExtensionRange pref.ProtoMessage
  24. Service pref.ProtoMessage
  25. Method pref.ProtoMessage
  26. )