mirror of
https://github.com/ap-pauloafonso/ratio-spoof.git
synced 2026-01-11 20:10:22 +00:00
21 lines
417 B
Go
21 lines
417 B
Go
package generator
|
|
|
|
import (
|
|
regen "github.com/zach-klippenstein/goregen"
|
|
)
|
|
|
|
type RegexPeerIdGenerator struct {
|
|
generated string
|
|
}
|
|
|
|
func NewRegexPeerIdGenerator(pattern string) (*RegexPeerIdGenerator, error) {
|
|
result, err := regen.Generate(pattern)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &RegexPeerIdGenerator{generated: result}, nil
|
|
}
|
|
|
|
func (d *RegexPeerIdGenerator) PeerId() string {
|
|
return d.generated
|
|
}
|