Add String method to all interfaces
This commit is contained in:
@@ -35,6 +35,7 @@ type Client interface {
|
||||
Stream(ctx context.Context, req Request, opts ...CallOption) (Streamer, error)
|
||||
StreamRemote(ctx context.Context, addr string, req Request, opts ...CallOption) (Streamer, error)
|
||||
Publish(ctx context.Context, p Publication, opts ...PublishOption) error
|
||||
String() string
|
||||
}
|
||||
|
||||
type Publication interface {
|
||||
@@ -122,3 +123,7 @@ func NewProtoRequest(service, method string, request interface{}, reqOpts ...Req
|
||||
func NewJsonRequest(service, method string, request interface{}, reqOpts ...RequestOption) Request {
|
||||
return DefaultClient.NewJsonRequest(service, method, request, reqOpts...)
|
||||
}
|
||||
|
||||
func String() string {
|
||||
return DefaultClient.String()
|
||||
}
|
||||
|
||||
@@ -258,3 +258,7 @@ func (r *rpcClient) NewProtoRequest(service, method string, request interface{},
|
||||
func (r *rpcClient) NewJsonRequest(service, method string, request interface{}, reqOpts ...RequestOption) Request {
|
||||
return newRpcRequest(service, method, request, "application/json", reqOpts...)
|
||||
}
|
||||
|
||||
func (r *rpcClient) String() string {
|
||||
return "rpc"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user