You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ntool-biz/ngochess/gtp/options.go

30 lines
535 B
Go

package gtp
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 uint) Option {
return func(options *Options) {
options.MaxMessageId = max
}
}
func WithTimeout(timeout time.Duration) Option {
return func(options *Options) {
options.Timeout = timeout
}
}