feat: refactor layers registration
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
This commit is contained in:
29
internal/proxy/director/layer/queue/options.go
Normal file
29
internal/proxy/director/layer/queue/options.go
Normal file
@ -0,0 +1,29 @@
|
||||
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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user