MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / paginationToPb

Function paginationToPb

app/controlplane/internal/service/workflow.go:347–354  ·  view source on GitHub ↗

paginationToPb converts a count, offset, and limit to a pb.OffsetPaginationResponse.

(count, offset, limit int)

Source from the content-addressed store, hash-verified

345
346// paginationToPb converts a count, offset, and limit to a pb.OffsetPaginationResponse.
347func 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.
357func pbJSONFilterToPkg(filter *v1.JSONFilter) *jsonfilter.JSONFilter {

Callers 8

ListMethod · 0.85
ListMembersMethod · 0.85
ListMethod · 0.85
ListMembersMethod · 0.85
ListProjectsMethod · 0.85
ListMembershipsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected