v2: Add cross-service client package

Add package with cross-service client utilities for working with transport
protocols and basic network types.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-20 12:28:00 +03:00 committed by Stanislav Bogatyrev
parent 28d8acc58a
commit 9253dac753
2 changed files with 131 additions and 0 deletions

23
v2/client/proto.go Normal file
View file

@ -0,0 +1,23 @@
package client
import (
"github.com/pkg/errors"
)
type Protocol uint32
const (
_ Protocol = iota
ProtoGRPC
)
var ErrProtoUnsupported = errors.New("unsupported protocol")
func (p Protocol) String() string {
switch p {
case ProtoGRPC:
return "GRPC"
default:
return "UNKNOWN"
}
}