legacy_hook.go 622 B

1234567891011121314151617
  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 impl
  5. import pvalue "github.com/golang/protobuf/v2/internal/value"
  6. // TODO: Add a default LegacyWrapper that panics with a more helpful message?
  7. var legacyWrapper pvalue.LegacyWrapper
  8. // RegisterLegacyWrapper registers a set of constructor functions that are
  9. // called when a legacy enum or message is encountered that does not natively
  10. // support the protobuf reflection APIs.
  11. func RegisterLegacyWrapper(w pvalue.LegacyWrapper) {
  12. legacyWrapper = w
  13. }