Documentation
¶
Index ¶
- Variables
- type BLMReader
- func (br *BLMReader) Close() error
- func (br *BLMReader) DataHeaders() []string
- func (br *BLMReader) Err() error
- func (br *BLMReader) FileHeader(key string) string
- func (br *BLMReader) HeadersByPattern(pattern string) ([]string, error)
- func (br *BLMReader) Next() error
- func (br *BLMReader) Row() []string
- func (br *BLMReader) SetRow(data []string)
- func (br *BLMReader) TotalRows() int64
- func (br *BLMReader) Value(key string) string
- func (br *BLMReader) Values(keys []string) []string
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BLMReader ¶ added in v0.1.1
type BLMReader struct {
// contains filtered or unexported fields
}
func NewFileReader ¶ added in v0.2.0
func NewStreamReader ¶ added in v0.2.0
func NewStreamReader(s io.ReadCloser) (*BLMReader, error)
func (*BLMReader) DataHeaders ¶ added in v0.2.0
DataHeaders returns the slice of column headers for the data section.
func (*BLMReader) Err ¶ added in v0.2.0
Err returns error if blm file is invalid. call it after Next() loop
func (*BLMReader) FileHeader ¶ added in v0.2.0
FileHeader returns the value associated with the specified key from the file-level header map (e.g., 'VERSION', 'DATE').
func (*BLMReader) HeadersByPattern ¶ added in v0.2.0
HeadersByPattern returns a slice of data headers that match the given regex pattern.
func (*BLMReader) Next ¶ added in v0.1.1
Next returns the next data row as a []string. It returns io.EOF when no more rows are available. It returns InvalidDataRow if the row length does not match the header length.
func (*BLMReader) SetRow ¶ added in v0.2.0
SetRow manually injects data into the reader's current row buffer.
This is primarily intended for testing or in-place data manipulation before or after calling processing functions.
Once SetRow is called, the reader's state is updated, allowing immediate use of accessor methods like Row(), Value(), and Values().
IMPORTANT: Do NOT call this function inside the Next() loop, as it will overwrite the data fetched from the underlying stream.