Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Sep 30, 2024
1 parent d9ca20c commit a19e8e6
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions internal/client/v1/client/filter/egress/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (c *client) Target(ctx context.Context, targets ...string) (egress.FilterCl
}

func (c *client) FilterDistance(
ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption,
) (res *payload.Object_Distance, err error) {
ctx context.Context, in *payload.Filter_DistanceRequest, opts ...grpc.CallOption,
) (res *payload.Filter_DistanceResponse, err error) {

Check warning on line 135 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L135

Added line #L135 was not covered by tests
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterDistance")
defer func() {
if span != nil {
Expand All @@ -144,7 +144,7 @@ func (c *client) FilterDistance(
copts ...grpc.CallOption,
) (any, error) {
res, err = egress.NewFilterClient(conn).FilterDistance(ctx, in, append(copts, opts...)...)
return nil, err
return res, err

Check warning on line 147 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L147

Added line #L147 was not covered by tests
})
if err != nil {
return nil, err
Expand All @@ -153,8 +153,8 @@ func (c *client) FilterDistance(
}

func (s *specificAddrClient) FilterDistance(
ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption,
) (res *payload.Object_Distance, err error) {
ctx context.Context, in *payload.Filter_DistanceRequest, opts ...grpc.CallOption,
) (res *payload.Filter_DistanceResponse, err error) {

Check warning on line 157 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L157

Added line #L157 was not covered by tests
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterDistance/"+s.addr)
defer func() {
if span != nil {
Expand All @@ -166,11 +166,7 @@ func (s *specificAddrClient) FilterDistance(
copts ...grpc.CallOption,
) (any, error) {
res, err = egress.NewFilterClient(conn).FilterDistance(ctx, in, append(copts, opts...)...)
if err != nil {
return nil, err
}
in = res
return in, nil
return res, err

Check warning on line 169 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L169

Added line #L169 was not covered by tests
})
if err != nil {
return nil, err
Expand All @@ -179,8 +175,8 @@ func (s *specificAddrClient) FilterDistance(
}

func (m *multipleAddrsClient) FilterDistance(
ctx context.Context, in *payload.Object_Distance, opts ...grpc.CallOption,
) (res *payload.Object_Distance, err error) {
ctx context.Context, in *payload.Filter_DistanceRequest, opts ...grpc.CallOption,
) (res *payload.Filter_DistanceResponse, err error) {

Check warning on line 179 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L179

Added line #L179 was not covered by tests
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterDistance/["+strings.Join(m.addrs, ",")+"]")
defer func() {
if span != nil {
Expand All @@ -195,8 +191,8 @@ func (m *multipleAddrsClient) FilterDistance(
if err != nil {
return err
}
in = res
return nil
in.Distance = res.Distance
return err

Check warning on line 195 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L194-L195

Added lines #L194 - L195 were not covered by tests
})
if err != nil {
return nil, err
Expand All @@ -205,8 +201,8 @@ func (m *multipleAddrsClient) FilterDistance(
}

func (c *client) FilterVector(
ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
) (res *payload.Object_Vector, err error) {
ctx context.Context, in *payload.Filter_VectorRequest, opts ...grpc.CallOption,
) (res *payload.Filter_VectorResponse, err error) {

Check warning on line 205 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L205

Added line #L205 was not covered by tests
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector")
defer func() {
if span != nil {
Expand All @@ -218,7 +214,7 @@ func (c *client) FilterVector(
copts ...grpc.CallOption,
) (any, error) {
res, err = egress.NewFilterClient(conn).FilterVector(ctx, in, append(copts, opts...)...)
return nil, err
return res, err

Check warning on line 217 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L217

Added line #L217 was not covered by tests
})
if err != nil {
return nil, err
Expand All @@ -227,8 +223,8 @@ func (c *client) FilterVector(
}

func (s *specificAddrClient) FilterVector(
ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
) (res *payload.Object_Vector, err error) {
ctx context.Context, in *payload.Filter_VectorRequest, opts ...grpc.CallOption,
) (res *payload.Filter_VectorResponse, err error) {

Check warning on line 227 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L227

Added line #L227 was not covered by tests
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector/"+s.addr)
defer func() {
if span != nil {
Expand All @@ -240,11 +236,7 @@ func (s *specificAddrClient) FilterVector(
copts ...grpc.CallOption,
) (any, error) {
res, err = egress.NewFilterClient(conn).FilterVector(ctx, in, append(copts, opts...)...)
if err != nil {
return nil, err
}
in = res
return in, nil
return res, err

Check warning on line 239 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L239

Added line #L239 was not covered by tests
})
if err != nil {
return nil, err
Expand All @@ -253,8 +245,8 @@ func (s *specificAddrClient) FilterVector(
}

func (m *multipleAddrsClient) FilterVector(
ctx context.Context, in *payload.Object_Vector, opts ...grpc.CallOption,
) (res *payload.Object_Vector, err error) {
ctx context.Context, in *payload.Filter_VectorRequest, opts ...grpc.CallOption,
) (res *payload.Filter_VectorResponse, err error) {

Check warning on line 249 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L249

Added line #L249 was not covered by tests
ctx, span := trace.StartSpan(ctx, apiName+"/Client.FilterVector/["+strings.Join(m.addrs, ",")+"]")
defer func() {
if span != nil {
Expand All @@ -269,8 +261,8 @@ func (m *multipleAddrsClient) FilterVector(
if err != nil {
return err
}
in = res
return nil
res.Vector = in.Vector
return err

Check warning on line 265 in internal/client/v1/client/filter/egress/client.go

View check run for this annotation

Codecov / codecov/patch

internal/client/v1/client/filter/egress/client.go#L264-L265

Added lines #L264 - L265 were not covered by tests
})
if err != nil {
return nil, err
Expand Down

0 comments on commit a19e8e6

Please sign in to comment.