Documentation ¶
Overview ¶
package customerimporter reads from the given customers.csv file and returns a sorted (data structure of your choice) of email domains along with the number of customers with e-mail addresses for each domain. Any errors should be logged (or handled). Performance matters (this is only ~3k lines, but *could* be 1m lines or run on a small machine).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Concurrency int InputCSVFilePathDefault string InputCSVFilePath0Lines string InputCSVFilePath10Lines string InputCSVFilePath3kLines string InputCSVFilePath10mLines string ReadBufferSizeInBytes int }
Config is a struct which encapsulates .env file variables.
func LoadConfig ¶
LoadConfig loads the configuration from the .env file.
type Customer ¶
type Customer struct { FirstName string LastName string Email string Gender string IPAddress string }
Customer struct represents a customer record in the CSV file.
type DomainCounter ¶
type DomainCounter struct {
// contains filtered or unexported fields
}
DomainCounter is a struct made for convenience for the results channel.
type Logger ¶
type Logger interface { Info(msg string, keyVals ...interface{}) Warn(msg string, keyVals ...interface{}) Error(msg string, keyVals ...interface{}) }
Logger is an interface representing the required logging methods.
type MockLogger ¶
type MockLogger struct {
Logs []string
}
MockLogger is a mock implementation of the Logger interface.