Skip to content
Snippets Groups Projects
Commit 7f438f05 authored by ko_oler's avatar ko_oler
Browse files

правки в client.go

parent 390c4294
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,6 @@ import ( ...@@ -5,7 +5,6 @@ import (
errorsgrpc "git.perx.ru/perxis/perxis-go/pkg/errors/grpc" errorsgrpc "git.perx.ru/perxis/perxis-go/pkg/errors/grpc"
"git.perx.ru/perxis/perxis-go/pkg/options" "git.perx.ru/perxis/perxis-go/pkg/options"
"git.perx.ru/perxis/perxis-go/proto/common"
pb "git.perx.ru/perxis/perxis-go/proto/log" pb "git.perx.ru/perxis/perxis-go/proto/log"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
...@@ -37,20 +36,15 @@ func (c *Client) Log(ctx context.Context, entries []*Entry) error { ...@@ -37,20 +36,15 @@ func (c *Client) Log(ctx context.Context, entries []*Entry) error {
return nil return nil
} }
func (c *Client) Find(ctx context.Context, filter *Filter, options *options.FindOptions) (*FindResult, error) { func (c *Client) Find(ctx context.Context, filter *Filter, opts *options.FindOptions) (*FindResult, error) {
request := new(pb.FindRequest) request := new(pb.FindRequest)
if filter != nil { if filter != nil {
request.Filter = &pb.Filter{Q: filter.Q} request.Filter = &pb.Filter{Q: filter.Q}
} }
if options != nil {
request.Options = &common.FindOptions{ request.Options = options.FindOptionsToPB(opts)
Sort: options.Sort,
Offset: int32(options.Offset),
Limit: int32(options.Limit),
PageSize: int32(options.PageSize),
PageNum: int32(options.PageNum),
}
}
response, err := c.client.Find(ctx, request) response, err := c.client.Find(ctx, request)
if err != nil { if err != nil {
return nil, err return nil, err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment