Helper functions to create test data
(workspaceID string, count int, timestamp time.Time, outcome string)
| 209 | // Helper functions to create test data |
| 210 | |
| 211 | func createVerifications(workspaceID string, count int, timestamp time.Time, outcome string) []schema.KeyVerification { |
| 212 | verifications := make([]schema.KeyVerification, count) |
| 213 | for i := range count { |
| 214 | verifications[i] = schema.KeyVerification{ |
| 215 | RequestID: uid.New(uid.RequestPrefix), |
| 216 | Time: timestamp.Add(time.Duration(i) * time.Second).UnixMilli(), |
| 217 | WorkspaceID: workspaceID, |
| 218 | KeySpaceID: uid.New(uid.KeySpacePrefix), |
| 219 | IdentityID: "", |
| 220 | ExternalID: "", |
| 221 | KeyID: uid.New(uid.KeyPrefix), |
| 222 | Region: "us-east-1", |
| 223 | Outcome: outcome, |
| 224 | Tags: []string{}, |
| 225 | SpentCredits: 0, |
| 226 | Latency: rand.Float64() * 100, |
| 227 | } |
| 228 | } |
| 229 | return verifications |
| 230 | } |
| 231 | |
| 232 | func createRatelimits(workspaceID string, count int, timestamp time.Time, passed bool) []schema.Ratelimit { |
| 233 | ratelimits := make([]schema.Ratelimit, count) |
no test coverage detected