Source File
option.go
Belonging Package
github.com/gobwas/pool
package poolimport// Option configures pool.type Option func(Config)// Config describes generic pool configuration.type Config interface {AddSize(n int)SetSizeMapping(func(int) int)}// WithSizeLogRange returns an Option that will add logarithmic range of// pooling sizes containing [min, max] values.func (, int) Option {return func( Config) {pmath.LogarithmicRange(, , func( int) {.AddSize()})}}// WithSize returns an Option that will add given pooling size to the pool.func ( int) Option {return func( Config) {.AddSize()}}func ( func(int) int) Option {return func( Config) {.SetSizeMapping()}}func () Option {return WithSizeMapping(pmath.CeilToPowerOfTwo)}func () Option {return WithSizeMapping(pmath.Identity)}
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |