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.
|
|
|
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
|
|
|
|
options.LineBufferSize = opt.LineBufferSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func WithLineBufferSize(size int) Option {
|
|
|
|
return func(options *Options) {
|
|
|
|
options.LineBufferSize = size
|
|
|
|
}
|
|
|
|
}
|