Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStreamExhausted ¶
IsStreamExhausted checks if the error is a stream exhausted error.
Parameters:
- err: The error to check.
Returns:
- bool: True if the error is a stream exhausted error. False otherwise.
Types ¶
type ErrStreamExhausted ¶
type ErrStreamExhausted struct{}
ErrStreamExhausted is the error returned when the stream is exhausted.
func NewStreamExhausted ¶
func NewStreamExhausted() *ErrStreamExhausted
NewStreamExhausted creates a new stream exhausted error.
Returns:
- *ErrStreamExhausted: The stream exhausted error.
func (*ErrStreamExhausted) Error ¶
func (e *ErrStreamExhausted) Error() string
Error implements the error interface.
Message: "stream is exhausted"
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is a stream of runes.
func NewStream ¶
NewStream creates a new stream.
Parameters:
- data: The data of the stream.
Returns:
- Stream: The stream.
func (*Stream) Accept ¶
func (s *Stream) Accept()
Accept accepts the lookahead rune.
Does nothing if there is no lookahead rune.
func (*Stream) Next ¶
Next returns the next rune and consumes it.
Returns:
- rune: The next rune.
- error: The error if any.
Click to show internal directories.
Click to hide internal directories.