Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferPool ¶
type BufferPool struct {
// contains filtered or unexported fields
}
BufferPool manages reusable byte buffers for response body reading
type PooledRequest ¶
type PooledRequest struct {
Method string
URL string
Headers map[string]string
QueryParams map[string]any
Body any
Timeout int64 // Use int64 for better performance
MaxRetries int
Context interface{} // context.Context
// Authentication
BasicAuth *BasicAuth
BearerToken string
}
PooledRequest represents a reusable request object
func (*PooledRequest) Reset ¶
func (r *PooledRequest) Reset()
Reset clears the request object for reuse
type PooledResponse ¶
type PooledResponse struct {
StatusCode int
Status string
Headers map[string][]string
Body string
RawBody []byte
ContentLength int64
Proto string
Duration int64 // nanoseconds for better performance
Attempts int
Request interface{} // *http.Request
Response interface{} // *http.Response
}
PooledResponse represents a reusable response object
func (*PooledResponse) Reset ¶
func (r *PooledResponse) Reset()
Reset clears the response object for reuse
type RequestPool ¶
type RequestPool struct {
// contains filtered or unexported fields
}
RequestPool manages reusable request objects to reduce allocations
func (*RequestPool) Get ¶
func (p *RequestPool) Get() *PooledRequest
Get retrieves a request object from the pool
func (*RequestPool) Put ¶
func (p *RequestPool) Put(req *PooledRequest)
Put returns a request object to the pool after resetting it
type ResponsePool ¶
type ResponsePool struct {
// contains filtered or unexported fields
}
ResponsePool manages reusable response objects
func (*ResponsePool) Get ¶
func (p *ResponsePool) Get() *PooledResponse
Get retrieves a response object from the pool
func (*ResponsePool) Put ¶
func (p *ResponsePool) Put(resp *PooledResponse)
Put returns a response object to the pool after resetting it
type StringBuilderPool ¶
type StringBuilderPool struct {
// contains filtered or unexported fields
}
StringBuilderPool manages reusable string builders for efficient string operations
func (*StringBuilderPool) Get ¶
func (p *StringBuilderPool) Get() *strings.Builder
Get retrieves a string builder from the pool
func (*StringBuilderPool) Put ¶
func (p *StringBuilderPool) Put(sb *strings.Builder)
Put returns a string builder to the pool after resetting it