MCPcopy Create free account
hub / github.com/cortexproject/cortex / GetRuleGroupNextToken

Function GetRuleGroupNextToken

pkg/ruler/ruler_pagination.go:16–20  ·  view source on GitHub ↗
(namespace string, group string)

Source from the content-addressed store, hash-verified

14func (gi PaginatedGroupStates) Len() int { return len(gi) }
15
16func GetRuleGroupNextToken(namespace string, group string) string {
17 h := sha1.New()
18 h.Write([]byte(namespace + ";" + group))
19 return hex.EncodeToString(h.Sum(nil))
20}
21
22// generatePage function takes in a sorted list of groups and returns a page of groups and the next token which can be
23// used to in subsequent requests. The # of groups per page is at most equal to maxRuleGroups. If the total passed in

Callers 5

getLocalRulesMethod · 0.85
TestMergeGroupStateDescFunction · 0.85
LessMethod · 0.85
generatePageFunction · 0.85

Calls 1

WriteMethod · 0.45