options.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2018 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 prototype
  5. // X provides functionality internal to the protobuf module.
  6. //
  7. // WARNING: The compatibility agreement covers nothing except for functionality
  8. // needed to keep existing generated messages operational. The Go authors
  9. // are not responsible for breakages that occur due to unauthorized usages.
  10. var X internal
  11. type internal struct{}
  12. // optionTypes contains typed nil-pointers to each of the options types.
  13. // These are populated at init time by the descriptor package.
  14. var optionTypes struct {
  15. File interface{}
  16. Enum interface{}
  17. EnumValue interface{}
  18. Message interface{}
  19. Field interface{}
  20. Oneof interface{}
  21. ExtensionRange interface{}
  22. Service interface{}
  23. Method interface{}
  24. }
  25. func (internal) RegisterFileOptions(m interface{}) { optionTypes.File = m }
  26. func (internal) RegisterEnumOptions(m interface{}) { optionTypes.Enum = m }
  27. func (internal) RegisterEnumValueOptions(m interface{}) { optionTypes.EnumValue = m }
  28. func (internal) RegisterMessageOptions(m interface{}) { optionTypes.Message = m }
  29. func (internal) RegisterFieldOptions(m interface{}) { optionTypes.Field = m }
  30. func (internal) RegisterOneofOptions(m interface{}) { optionTypes.Oneof = m }
  31. func (internal) RegisterExtensionRangeOptions(m interface{}) { optionTypes.ExtensionRange = m }
  32. func (internal) RegisterServiceOptions(m interface{}) { optionTypes.Service = m }
  33. func (internal) RegisterMethodOptions(m interface{}) { optionTypes.Method = m }