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