str

package
v1.1.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package str implements the Input interface for strings by leveraging the file.Reader type. This is especially useful in conjunction with http.Get. This package also supports reading from Excel XLSX files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReader

func NewReader(s string, separator, eol, quote rune, width int, skip int, maxRead int) *file.Reader

NewReader generates a new file.Reader for the string input.

func NewXlReader

func NewXlReader(xl *excelize.File, sheet string, rowS, rowE, colS, colE int, quote rune, skip, maxRead int) *file.Reader

NewXlReader creates a *file.Reader for an Excel spreadsheet. The sheet is read into a string and then initialized using str.NewReader xl - XL file (stream) to read sheet - sheet to read. If this is empty, the first sheet is read rowS - start row (index is 0-based) rowE - end row (0 means all rows) colS - start column (index is 0-based) colE - end column (0 means all columns) quote - string quotes skip - rows to skip before reading data maxRead - max # rows to read

Types

type ReaderCloser

type ReaderCloser struct {
	*strings.Reader
}

ReaderCloser just embeds a *strings.Reader

func (*ReaderCloser) Close

func (r *ReaderCloser) Close() error

Close implements the Close method for ReaderCloser.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL