forked from TrueCloudLab/frostfs-api-go
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:
parent
28d8acc58a
commit
9253dac753
2 changed files with 131 additions and 0 deletions
23
v2/client/proto.go
Normal file
23
v2/client/proto.go
Normal 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"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue