Documentation
¶
Overview ¶
Package lender contains the structure and logic for a lender type. Also contains functions for importing lenders
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldParseError ¶
type FieldParseError struct { // Cause is the root cause of the parsing error. Cause error // LineNo is the line (row) that the error occurred on. LineNo int // Field is the name of the field where the error occurrd. Field string }
FieldParseError is an error structure that is used when importing a csv file. A custom structure is used to provide additional information when debugging an import problem of a csv file.
func NewFieldParseError ¶
func NewFieldParseError(lineNo int, field string, cause error) *FieldParseError
NewFieldParseError is a helper function for creating a field parse error. Returns a pointer to a new FieldParseError structure.
func (*FieldParseError) Error ¶
func (l *FieldParseError) Error() string
The Error function is used to satisfy the error interface. Returns a string represntation of the FieldParseError.
type Lender ¶
Lender is a structure representing an individual lender.
type Lenders ¶
type Lenders []Lender
Lenders represents a slice of lenders. The type also has methods to support sort interface
func ImportCSV ¶
ImportCSV is a function used to import a csv file located by filename, parse and convert to a Lenders slice of Lender structures. Returns a Lenders slice of lenders if successfully imported, or the assoicated error otherwise.