paginationToPb converts a count, offset, and limit to a pb.OffsetPaginationResponse.
(count, offset, limit int)
| 345 | |
| 346 | // paginationToPb converts a count, offset, and limit to a pb.OffsetPaginationResponse. |
| 347 | func paginationToPb(count, offset, limit int) *pb.OffsetPaginationResponse { |
| 348 | return &pb.OffsetPaginationResponse{ |
| 349 | TotalCount: int32(count), |
| 350 | Page: int32(offset/limit) + 1, |
| 351 | TotalPages: (int32(count) + int32(limit) - 1) / int32(limit), |
| 352 | PageSize: int32(limit), |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | // pbJSONFilterToPkg converts a v1.JSONFilter to a jsonfilter.JSONFilter. |
| 357 | func pbJSONFilterToPkg(filter *v1.JSONFilter) *jsonfilter.JSONFilter { |
no outgoing calls
no test coverage detected