runtime: expose protoimpl and protolegacy

The internal/impl and internal/legacy packages are only visible from packages
within the v2 repository. However, selected parts of these packages need to
be visible from the v1 repository or from generated code.

Change-Id: I1d87227dacc38f5b1ac464e9b9dd43bd34559cda
Reviewed-on: https://go-review.googlesource.com/c/151858
Reviewed-by: Herbie Ong <herbie@google.com>
diff --git a/runtime/protoimpl/impl.go b/runtime/protoimpl/impl.go
new file mode 100644
index 0000000..ce36302
--- /dev/null
+++ b/runtime/protoimpl/impl.go
@@ -0,0 +1,18 @@
+// 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 "github.com/golang/protobuf/v2/internal/impl"
+
+var X impl.Export
+
+type MessageType = impl.MessageType
diff --git a/runtime/protolegacy/legacy.go b/runtime/protolegacy/legacy.go
new file mode 100644
index 0000000..1544a50
--- /dev/null
+++ b/runtime/protolegacy/legacy.go
@@ -0,0 +1,16 @@
+// 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 protolegacy contains the default implementation for messages
+// generated by protoc-gen-go.
+//
+// WARNING: This package should only ever be imported by the v1 proto package.
+// The compatibility agreement covers nothing except for functionality needed
+// to provide v1 interoperability. Breakages that occur due to unauthorized
+// usages of this package are not the author's responsibility.
+package protolegacy
+
+import "github.com/golang/protobuf/v2/internal/legacy"
+
+var X legacy.Export