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

правки в client.go

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