1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00
This commit is contained in:
Asim
2015-12-09 21:41:55 +00:00
parent 46687746a4
commit 8cfad5db33
2 changed files with 7 additions and 7 deletions

View File

@ -93,8 +93,8 @@ var _ server.Option
// Client API for Example service
type ExampleClient interface {
Call(ctx context.Context, in *Request) (*Response, error)
Stream(ctx context.Context, in *StreamingRequest) (Example_StreamClient, error)
Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error)
Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Example_StreamClient, error)
}
type exampleClient struct {
@ -115,20 +115,20 @@ func NewExampleClient(serviceName string, c client.Client) ExampleClient {
}
}
func (c *exampleClient) Call(ctx context.Context, in *Request) (*Response, error) {
func (c *exampleClient) Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error) {
req := c.c.NewRequest(c.serviceName, "Example.Call", in)
out := new(Response)
err := c.c.Call(ctx, req, out)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *exampleClient) Stream(ctx context.Context, in *StreamingRequest) (Example_StreamClient, error) {
func (c *exampleClient) Stream(ctx context.Context, in *StreamingRequest, opts ...client.CallOption) (Example_StreamClient, error) {
req := c.c.NewRequest(c.serviceName, "Example.Stream", in)
outCh := make(chan *StreamingResponse)
stream, err := c.c.Stream(ctx, req, outCh)
stream, err := c.c.Stream(ctx, req, outCh, opts...)
if err != nil {
return nil, err
}