Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseCache ¶
type ResponseCache struct {
// contains filtered or unexported fields
}
func NewResponseCache ¶
func NewResponseCache() *ResponseCache
func (*ResponseCache) Get ¶
func (c *ResponseCache) Get(key string) ([]byte, bool)
Get retrieves a non-streaming response from the cache.
func (*ResponseCache) GetStream ¶
func (c *ResponseCache) GetStream(key string) (*StreamResponse, bool)
GetStream retrieves a streaming response from the cache.
func (*ResponseCache) Set ¶
func (c *ResponseCache) Set(key string, value []byte)
Set stores a non-streaming response in the cache.
func (*ResponseCache) SetStream ¶
func (c *ResponseCache) SetStream(key string, bufferSize int) *StreamResponse
SetStream initializes a streaming response in the cache.
type StreamResponse ¶
func NewStreamResponse ¶
func NewStreamResponse(bufferSize int) *StreamResponse
func (*StreamResponse) Close ¶
func (sr *StreamResponse) Close()
func (*StreamResponse) ReadChunks ¶
func (sr *StreamResponse) ReadChunks() <-chan []byte
func (*StreamResponse) WriteChunk ¶
func (sr *StreamResponse) WriteChunk(chunk []byte)
Click to show internal directories.
Click to hide internal directories.