Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface { WriteString(string) (int, error) WriteByte(byte) error Write([]byte) (int, error) Len() int Cap() int String() string Reset() }
Builder compatible with bytes.Buffer compatible with strings.Builder compatible with "go.uber.org/zap/buffer".Buffer compatible with "github.com/dubbogo/gost/bytes".Buffer
type Pool ¶
type Pool[T any] struct { // contains filtered or unexported fields }
A Pool is a generic wrapper around sync.Pool to provide strongly-typed object pooling.
Note that SA6002 (ref: https://staticcheck.io/docs/checks/#SA6002) will not be detected, so all internal pool use must take care to only store pointer types.
func New ¶
New returns a new Pool for T, and will use fn to construct new Ts when the pool is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.