21 lines
301 B
Go
21 lines
301 B
Go
|
|
package nomino
|
||
|
|
|
||
|
|
type Config struct {
|
||
|
|
original string
|
||
|
|
prefix string
|
||
|
|
suffix string
|
||
|
|
extension string
|
||
|
|
generator Generator
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewConfig(options ...Option) Config {
|
||
|
|
conf := Config{
|
||
|
|
extension: ".txt",
|
||
|
|
generator: uuidGen,
|
||
|
|
}
|
||
|
|
for _, opt := range options {
|
||
|
|
opt(&conf)
|
||
|
|
}
|
||
|
|
return conf
|
||
|
|
}
|