impl.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 protoimpl contains the default implementation for messages
  5. // generated by protoc-gen-go.
  6. //
  7. // WARNING: This package should only ever be imported by generated messages.
  8. // The compatibility agreement covers nothing except for functionality needed
  9. // to keep existing generated messages operational. Breakages that occur due
  10. // to unauthorized usages of this package are not the author's responsibility.
  11. package protoimpl
  12. import (
  13. "google.golang.org/protobuf/internal/fileinit"
  14. "google.golang.org/protobuf/internal/impl"
  15. )
  16. // Version is the current minor version of the package.
  17. // This is incremented every time the API of this package expands.
  18. const Version = 0 // v2.{Version}.x
  19. var X impl.Export
  20. type (
  21. // EnforceVersion is used by code generated by protoc-gen-go
  22. // to statically enforce a minimum version of this package.
  23. // A compilation failure implies that this package is too old and
  24. // needs to be updated to a more recent version.
  25. //
  26. // This package can be upgraded by running:
  27. // go get -u google.golang.org/protobuf/...
  28. //
  29. // Example usage by generated code:
  30. // const _ = protoimpl.EnforceVersion(protoimpl.Version - genVersion)
  31. //
  32. // If genVersion is lower than Version, then this results in a negative
  33. // integer overflow failure when evaluating the uint constant.
  34. EnforceVersion uint
  35. MessageType = impl.MessageType
  36. FileBuilder = fileinit.FileBuilder
  37. // TODO: Change these to more efficient data structures.
  38. ExtensionFields = map[int32]impl.ExtensionFieldV1
  39. UnknownFields = []byte
  40. SizeCache = int32
  41. ExtensionFieldV1 = impl.ExtensionFieldV1
  42. )