Documentation
¶
Index ¶
- Constants
- func CalculateChecksum(r libio.Reader) (uint32, error)
- func NewReadWriter(r libio.Reader, w libio.Writer) libio.ReadWriter
- func Peek(p []byte, n int) byte
- func ReadConfirmation(prompt string, src libio.Reader, dst libio.Writer) (choice bool, err error)
- func ReadOsConfirmation(prompt string) (bool, error)
- func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error)
- func SeekPrefixedLinesEnd(r libio.Reader, prefix []byte) (int64, error)
- type PrefixScanner
- type PrefixWriter
- type ReadWriter
Constants ¶
View Source
const ( // Newline character NL = '\n' // Carriage Return character CR = '\r' )
Variables ¶
This section is empty.
Functions ¶
func NewReadWriter ¶
NewReadWriter create as new io.ReadWriter instance using the given read and writer instance.
func ReadConfirmation ¶
func ReadOsConfirmation ¶
func ScanLines ¶
ScanLines is a splitter function for a bufio.Scanner instance. it is the same implementation as the one from the golang library, except it preserves the terminating newline characters
func SeekPrefixedLinesEnd ¶
SeekPrefixedLinesEnd reads lines from the provided reader and adds up their length if they are prefixed. The resulting byte count is the seek position from the start to skip the affected lines. Lines not starting with the prefix stop the search. Any error is from the underlying reader.
Types ¶
type PrefixScanner ¶
type PrefixScanner struct {
// contains filtered or unexported fields
}
func NewPrefixScanner ¶
func NewPrefixScanner(reader libio.Reader, prefix []byte) *PrefixScanner
func (*PrefixScanner) Next ¶
func (r *PrefixScanner) Next() ([]byte, error)
type PrefixWriter ¶
type PrefixWriter struct {
// contains filtered or unexported fields
}
func NewPrefixWriter ¶
func NewPrefixWriter(writer libio.Writer, prefix []byte) *PrefixWriter
Click to show internal directories.
Click to hide internal directories.