MCPcopy Create free account
hub / github.com/coder/coder / GenerateUserIdentifier

Function GenerateUserIdentifier

scaletest/loadtestutil/names.go:23–32  ·  view source on GitHub ↗

GenerateUserIdentifier generates a username and email for scale testing. The username follows the pattern: scaletest- - The email follows the pattern: - @scaletest.local

(id string)

Source from the content-addressed store, hash-verified

21// The username follows the pattern: scaletest-<random>-<id>
22// The email follows the pattern: <random>-<id>@scaletest.local
23func GenerateUserIdentifier(id string) (username, email string, err error) {
24 randStr, err := cryptorand.String(DefaultRandLength)
25 if err != nil {
26 return "", "", err
27 }
28
29 username = fmt.Sprintf("%s-%s-%s", ScaleTestPrefix, randStr, id)
30 email = fmt.Sprintf("%s-%s%s", randStr, id, EmailDomain)
31 return username, email, nil
32}
33
34// GenerateWorkspaceName generates a workspace name for scale testing.
35// The workspace name follows the pattern: scaletest-<random>-<id>

Callers 1

RunReturningUserMethod · 0.92

Calls 1

StringFunction · 0.92

Tested by

no test coverage detected