Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsClientDisconnect ¶
IsClientDisconnect checks if error is a client disconnect
func IsConnectionClosed ¶
IsConnectionClosed checks if error indicates closed connection
func IsExpectedError ¶
IsExpectedError checks if error is expected (not a real error)
Types ¶
type ChunkProcessor ¶
type ChunkProcessor interface {
Process(ctx context.Context, data []byte) ([]byte, error)
Provider() string
}
ChunkProcessor handles format conversion and business logic
type ConnectionState ¶
type ConnectionState interface {
IsConnected() bool
Done() <-chan struct{}
}
ConnectionState tracks client connection status
type StreamError ¶
type StreamError struct {
Type StreamErrorType
Message string
Cause error
RequestID string
}
StreamError provides structured error handling
func NewClientDisconnectError ¶
func NewClientDisconnectError(requestID string) *StreamError
Error constructors
func NewInternalError ¶
func NewInternalError(requestID, message string, cause error) *StreamError
func NewProviderError ¶
func NewProviderError(requestID, provider string, cause error) *StreamError
func NewStreamCompleteError ¶
func NewStreamCompleteError(requestID string) *StreamError
func (*StreamError) Error ¶
func (e *StreamError) Error() string
func (*StreamError) IsExpected ¶
func (e *StreamError) IsExpected() bool
IsExpected returns true if this error type is expected (client disconnect, etc.)
func (*StreamError) Unwrap ¶
func (e *StreamError) Unwrap() error
type StreamErrorType ¶
type StreamErrorType int
StreamErrorType categorizes different types of streaming errors
const ( // Expected errors - not logged as errors ClientDisconnect StreamErrorType = iota StreamComplete // Unexpected errors - logged as errors ProviderError InternalError )
type StreamHandler ¶
type StreamHandler interface {
Handle(ctx context.Context, writer StreamWriter) error
}
StreamHandler orchestrates the streaming pipeline
type StreamReader ¶
StreamReader provides pure I/O reading interface
Click to show internal directories.
Click to hide internal directories.