9253dac753
Add package with cross-service client utilities for working with transport protocols and basic network types. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
23 lines
293 B
Go
23 lines
293 B
Go
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"
|
|
}
|
|
}
|