edge/pkg/bus/memory/option.go

20 lines
276 B
Go
Raw Normal View History

2023-02-09 12:16:36 +01:00
package memory
type Option struct {
BufferSize int64
}
type OptionFunc func(*Option)
func DefaultOption() *Option {
return &Option{
BufferSize: 16, // nolint: gomnd
}
}
func WithBufferSize(size int64) OptionFunc {
return func(o *Option) {
o.BufferSize = size
}
}