protobuf-go/runtime/protoimpl/impl.go
Joe Tsai 4fe9663f4c internal/impl: rename MessageType as MessageInfo
The name MessageType is easily confused with protoreflect.MessageType.
Rename it as MessageInfo, which follows the pattern set by v1,
where the equivalent data structure is called InternalMessageInfo.

Change-Id: I535956e1f7c6e9b07e9585e889d5e93388d0d2ce
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/178478
Reviewed-by: Damien Neil <dneil@google.com>
2019-05-22 14:54:35 +00:00

51 lines
1.7 KiB
Go

// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package protoimpl contains the default implementation for messages
// generated by protoc-gen-go.
//
// WARNING: This package should only ever be imported by generated messages.
// The compatibility agreement covers nothing except for functionality needed
// to keep existing generated messages operational. Breakages that occur due
// to unauthorized usages of this package are not the author's responsibility.
package protoimpl
import (
"google.golang.org/protobuf/internal/fileinit"
"google.golang.org/protobuf/internal/impl"
)
// Version is the current minor version of the package.
// This is incremented every time the API of this package expands.
const Version = 0 // v2.{Version}.x
var X impl.Export
type (
// EnforceVersion is used by code generated by protoc-gen-go
// to statically enforce a minimum version of this package.
// A compilation failure implies that this package is too old and
// needs to be updated to a more recent version.
//
// This package can be upgraded by running:
// go get -u google.golang.org/protobuf/...
//
// Example usage by generated code:
// const _ = protoimpl.EnforceVersion(protoimpl.Version - genVersion)
//
// If genVersion is lower than Version, then this results in a negative
// integer overflow failure when evaluating the uint constant.
EnforceVersion uint
MessageInfo = impl.MessageInfo
FileBuilder = fileinit.FileBuilder
// TODO: Change these to more efficient data structures.
ExtensionFields = map[int32]impl.ExtensionFieldV1
UnknownFields = []byte
SizeCache = int32
ExtensionFieldV1 = impl.ExtensionFieldV1
)