Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( //ErrUnsupportedEncoding signals an encoding that cannot be converted ErrUnsupportedEncoding = errors.New("Unsupported encoding") //ErrAuthorization declares a permission issue ErrAuthorization = errors.New("Permission denied") //ErrTimeout indicates a timeout ErrTimeout = errors.New("Timeout") //ErrNotFound states there is no convention file ErrNotFound = errors.New("No convention file") )
var ( //Integer is a regex to express the integer part for a possible real number. //We just ignore the floating part Integer = regexp.MustCompile(`^(\d+)`) )
Functions ¶
This section is empty.
Types ¶
type ConventionReader ¶
ConventionReader interfaces the source where to read conventions
type Conventions ¶
type Conventions interface {
Import() ([]schema.Convention, *ImportError)
}
Conventions allows to import conventions
type CsvConventions ¶
type CsvConventions struct { Reader ConventionReader Year int // contains filtered or unexported fields }
CsvConventions parses conventions from CSV files
func NewCsvConventions ¶
func NewCsvConventions(r ConventionReader, promotions []string) *CsvConventions
NewCsvConventions creates an importer from a given reader By default, the parsed year is the current year
func (*CsvConventions) Import ¶
func (f *CsvConventions) Import() ([]schema.Convention, *ImportError)
Import imports all the conventions by requesting in parallel the conventions for each registered promotions
type HTTPConventionReader ¶
type HTTPConventionReader struct { Encoding string // contains filtered or unexported fields }
HTTPConventionReader reads conventions that are made available from the Http server
func NewHTTPConventionReader ¶
func NewHTTPConventionReader(url, login, password string) *HTTPConventionReader
NewHTTPConventionReader creates a new reader. Default encoding is "windows-1252"
type ImportError ¶
ImportError to report a critical error and multiple warnings
func (*ImportError) Error ¶
func (e *ImportError) Error() string
Error reports the critical errors and the possible warnings.
func (*ImportError) NewWarning ¶
func (e *ImportError) NewWarning(err ...string)
NewWarning signal a new warning to report