Documentation ¶
Index ¶
- Variables
- func CheckLen(split []string, expected int) (err error)
- func ErrorToString(ew ErrorWriter, e error) (s string, err error)
- func MaxLen(sec Sections) (maxlen int64, err error)
- func MustHave(get Getter, key string) (err error)
- func PanicOnErr(err error)
- type BinaryReader
- type CreateGetter
- type Default
- type Delimiter
- type Error
- type ErrorFn
- type ErrorUnwrapper
- type ErrorWrapper
- type ErrorWrapperKind
- type ErrorWriter
- type Getter
- type InMemoryStorage
- type Len
- type Locations
- type LogErrorWrap
- type Map
- type MapManager
- type MapPool
- type MissingKey
- type Mode
- type MutGetter
- type NoMatchedLayout
- type Parser
- type ReadResults
- type ReaderHandler
- type ReaderWrapper
- type Scanner
- type Section
- type SectionHandler
- type SectionKind
- type SectionReader
- type Sections
- type Setter
- type Setup
- type SimpleErrorWrapper
- type SplitError
- type SplitWrapErr
- type Splitter
- type TeeGetter
- type TestCase
- type TestWithSetup
- type Time
- type TimeLayouts
- type TimeZone
- type WrapError
- type WrapFunc
- type WrapScanner
- type WrongElementNumber
Constants ¶
This section is empty.
Variables ¶
View Source
var NegativeOrZeroLength = fmt.Errorf("got negative or zero length for maximum length")
Functions ¶
func ErrorToString ¶
func ErrorToString(ew ErrorWriter, e error) (s string, err error)
func PanicOnErr ¶
func PanicOnErr(err error)
Types ¶
type BinaryReader ¶
type BinaryReader struct {
// contains filtered or unexported fields
}
func NewBinaryReader ¶
func NewBinaryReader(log *zerolog.Logger) (br BinaryReader)
func (BinaryReader) ReadSections ¶
func (br BinaryReader) ReadSections(r io.Reader, sec Sections) (rr ReadResults, err error)
type ErrorWrapper ¶
type ErrorWrapperKind ¶
type ErrorWrapperKind int
const ( ErrorWrapperSimple ErrorWrapperKind = iota ErrorWrapperLogging )
func (ErrorWrapperKind) New ¶
func (e ErrorWrapperKind) New() (ew ErrorWrapper)
type InMemoryStorage ¶
func (InMemoryStorage) ToMap ¶
func (in InMemoryStorage) ToMap() (m Map)
type LogErrorWrap ¶
type LogErrorWrap struct { Wrapper ErrorWrapper Logger *log.Logger }
func (LogErrorWrap) LogContext ¶
func (l LogErrorWrap) LogContext(ctx string, e error, fn WrapFunc) (err error)
func (LogErrorWrap) WrapParseError ¶
func (l LogErrorWrap) WrapParseError(line string, mode Mode, e error) (err error)
func (LogErrorWrap) WrapSplitError ¶
func (l LogErrorWrap) WrapSplitError(line string, e error) (err error)
type MapManager ¶
type MapPool ¶
type MapPool struct {
// contains filtered or unexported fields
}
func NewMapPool ¶
func NewMapPool() (mp *MapPool)
type MissingKey ¶
type MissingKey struct {
Key string
}
func (MissingKey) Error ¶
func (m MissingKey) Error() (s string)
type NoMatchedLayout ¶
type NoMatchedLayout struct {
LastError error
}
func (NoMatchedLayout) Error ¶
func (n NoMatchedLayout) Error() (s string)
func (NoMatchedLayout) Unwrap ¶
func (n NoMatchedLayout) Unwrap() (err error)
type ReadResults ¶
func ReadSections ¶
func ReadSections(r io.Reader, sections Sections) (rr ReadResults, err error)
type ReaderHandler ¶
type ReaderHandler interface {
HandleReaders(readers []SectionReader) (r ReadResults, err error)
}
type Section ¶
type Section struct { ID string Kind SectionKind Len Len }
func ReadSection ¶
func SkipSection ¶
type SectionHandler ¶
type SectionHandler interface {
HandleSection(r io.Reader, sec Section, rr ReadResults) (err error)
}
type SectionKind ¶
type SectionKind int
const ( SectionRead SectionKind = iota SectionSkip TotalSections )
type SectionReader ¶
type SectionReader interface {
ReadSections(r io.Reader, sections Sections) (rr ReadResults, err error)
}
type Setup ¶
type Setup struct { Splitter Splitter Wrapper ReaderWrapper }
type SimpleErrorWrapper ¶
type SimpleErrorWrapper struct{}
func (SimpleErrorWrapper) WrapParseError ¶
func (SimpleErrorWrapper) WrapParseError(line string, mode Mode, err error) (e error)
func (SimpleErrorWrapper) WrapSplitError ¶
func (SimpleErrorWrapper) WrapSplitError(line string, err error) (e error)
type SplitError ¶
type SplitError struct { Line string // contains filtered or unexported fields }
func (SplitError) Error ¶
func (s SplitError) Error() (str string)
func (SplitError) Unwrap ¶
func (s SplitError) Unwrap() (err error)
type SplitWrapErr ¶
type SplitWrapErr struct { Splitter Splitter Wrapper ErrorWrapper }
type TeeGetter ¶
type TeeGetter struct {
// contains filtered or unexported fields
}
Wrapper for reading from many Retreivers. It will try to read the appropriate parameters from each of the receivers. Returns with error if parameter could not be found in any of them.
func NewTeeGetter ¶
type TestWithSetup ¶
func (TestWithSetup) ForEach ¶
func (ts TestWithSetup) ForEach(fn ErrorFn, creator CreateGetter)
func (TestWithSetup) Test ¶
func (ts TestWithSetup) Test(t *testing.T, creator CreateGetter)
func (TestWithSetup) TestErr ¶
func (ts TestWithSetup) TestErr(creator CreateGetter) (err error)
type TimeLayouts ¶
type TimeLayouts struct {
// contains filtered or unexported fields
}
func NewLayouts ¶
func NewLayouts(layouts ...string) (t TimeLayouts)
type WrapError ¶
type WrapError struct {
// contains filtered or unexported fields
}
func (WrapError) ParseFloat ¶
type WrapScanner ¶
type WrapScanner struct{}
func WrapIntoScanner ¶
func WrapIntoScanner() (w WrapScanner)
func (WrapScanner) WrapReader ¶
type WrongElementNumber ¶
func (WrongElementNumber) Error ¶
func (w WrongElementNumber) Error() (s string)
Click to show internal directories.
Click to hide internal directories.