[#276] Merge repo with frostfs-api-go
All checks were successful
DCO / DCO (pull_request) Successful in 38s
Tests and linters / Tests (pull_request) Successful in 1m13s
Tests and linters / Lint (pull_request) Successful in 2m36s

Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
This commit is contained in:
Pavel Pogodaev 2024-10-07 17:20:25 +03:00 committed by pogpp
parent 5361f0eceb
commit 6ce73790ea
337 changed files with 66666 additions and 283 deletions

View file

@ -0,0 +1,22 @@
package encoding
import (
_ "google.golang.org/grpc/encoding/proto" // Ensure default codec is registered before our one.
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/protoadapt"
)
// messageV2Of converts v to a proto.Message.
// This is needed for this library to continue working in presence of external gRPC packages,
// such as opentelemetry gRPC exporter.
// Copied from https://github.com/grpc/grpc-go/blob/e524655becd8d4c7ba9e8687faef456e495e341e/encoding/proto/proto.go#L59.
func messageV2Of(v any) proto.Message {
switch v := v.(type) {
case protoadapt.MessageV1:
return protoadapt.MessageV2Of(v)
case protoadapt.MessageV2:
return v
}
return nil
}