Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #349 from ecordell/enable-e2e
e2e: fill schema with many namespaces to span ranges
- Loading branch information
Showing
11 changed files
with
463 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package generator | ||
|
||
import "github.com/brianvoe/gofakeit/v6" | ||
|
||
type UniqueGenerator struct { | ||
seen map[string]struct{} | ||
regex string | ||
} | ||
|
||
func NewUniqueGenerator(regex string) *UniqueGenerator { | ||
return &UniqueGenerator{ | ||
seen: make(map[string]struct{}, 0), | ||
regex: regex, | ||
} | ||
} | ||
|
||
func (g *UniqueGenerator) Next() string { | ||
for { | ||
val := gofakeit.Regex(g.regex) | ||
if _, ok := g.seen[val]; !ok { | ||
g.seen[val] = struct{}{} | ||
return val | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.