Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CityColumn = map[string]int{
"ZIP_DETAIL": 7,
"Unique_ZIP_DETAIL": 7,
"Other": 11,
}
CityColumn used to allocate which column in each page contains city
Pay attention military zones data don't contain real physical location
var LocaleNameColumn = map[string]int{
"ZIP_DETAIL": 5,
"Unique_ZIP_DETAIL": 5,
"Other": 7,
}
LocaleNameColumn used to allocate which column in each page contains locale name
var StateColumn = map[string]int{
"ZIP_DETAIL": 8,
"Unique_ZIP_DETAIL": 8,
"Other": 12,
}
StateColumn used to allocate which column in each page contains states Pay attention military zones data don't contain real physical location
var ZipColumn = map[string]int{
"ZIP_DETAIL": 4,
"Unique_ZIP_DETAIL": 4,
"Other": 5,
}
ZipColumn used to allocate which column in each page contains zips
Functions ¶
func WithProvider ¶
func WithProvider(provider ZipProvider) func(*ZipFetcher)
Types ¶
type UspsProvider ¶
type UspsProvider struct { LastUpdateDate time.Time LastRequestDate time.Time XlsPath string // contains filtered or unexported fields }
func CreateUspsProvider ¶
func CreateUspsProvider() *UspsProvider
func (*UspsProvider) GetLastModificationDate ¶
func (usps *UspsProvider) GetLastModificationDate() (time.Time, error)
func (*UspsProvider) GetZips ¶
func (usps *UspsProvider) GetZips() ([]ZipCode, error)
type ZipFetcher ¶
type ZipFetcher struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(provider ...func(*ZipFetcher)) *ZipFetcher
default provider - UspsProvider
func (*ZipFetcher) CheckIfModifiedSince ¶
func (zf *ZipFetcher) CheckIfModifiedSince(date string) (bool, error)
CheckIfModifiedSince checking if data was modified after the date
date format: yyyy-mm-dd
func (*ZipFetcher) GetAllZips ¶
func (zf *ZipFetcher) GetAllZips() ([]ZipCode, error)
GetAllZips return all zips
func (*ZipFetcher) GetAllZipsIfModifiedSince ¶
func (zf *ZipFetcher) GetAllZipsIfModifiedSince(date string) ([]ZipCode, error)
GetAllZipsIfModifiedSince return all zips if data was modified after the date.
If not modified, would return empty list without error