William Petit
ce2c19f9b3
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
32 lines
520 B
Go
32 lines
520 B
Go
package queue
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Options struct {
|
|
TemplateDir string
|
|
DefaultKeepAlive time.Duration
|
|
}
|
|
|
|
type OptionFunc func(*Options)
|
|
|
|
func defaultOptions() *Options {
|
|
return &Options{
|
|
TemplateDir: "./templates",
|
|
DefaultKeepAlive: time.Minute,
|
|
}
|
|
}
|
|
|
|
func WithTemplateDir(templateDir string) OptionFunc {
|
|
return func(o *Options) {
|
|
o.TemplateDir = templateDir
|
|
}
|
|
}
|
|
|
|
func WithDefaultKeepAlive(keepAlive time.Duration) OptionFunc {
|
|
return func(o *Options) {
|
|
o.DefaultKeepAlive = keepAlive
|
|
}
|
|
}
|