MCPcopy
hub / github.com/gotify/server / Tokens

Function Tokens

test/token.go:6–16  ·  view source on GitHub ↗

Tokens returns a token generation function with takes a series of tokens and output them in order.

(tokens ...string)

Source from the content-addressed store, hash-verified

4
5// Tokens returns a token generation function with takes a series of tokens and output them in order.
6func Tokens(tokens ...string) func() string {
7 var i int
8 lock := sync.Mutex{}
9 return func() string {
10 lock.Lock()
11 defer lock.Unlock()
12 res := tokens[i%len(tokens)]
13 i++
14 return res
15 }
16}

Callers 3

BeforeTestMethod · 0.92
BeforeTestMethod · 0.92
TestTokenGenerationFunction · 0.85

Calls

no outgoing calls

Tested by 3

BeforeTestMethod · 0.74
BeforeTestMethod · 0.74
TestTokenGenerationFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…