feat: katago options

main v1.3.7
NoahLan 1 year ago
parent 217f715f23
commit cae5165dbc

@ -0,0 +1,29 @@
package katago
import "time"
func WithOptions(opt Options) Option {
return func(options *Options) {
options.DevMode = opt.DevMode
options.MaxMessageId = opt.MaxMessageId
options.Timeout = opt.Timeout
}
}
func WithDevMode(val bool) Option {
return func(options *Options) {
options.DevMode = val
}
}
func WithMaxMessageId(max uint64) Option {
return func(options *Options) {
options.MaxMessageId = max
}
}
func WithTimeout(timeout time.Duration) Option {
return func(options *Options) {
options.Timeout = timeout
}
}
Loading…
Cancel
Save