Documentation ¶
Overview ¶
Package file performs operations related to file discovery, validation, conversion and load to the cache
Index ¶
- func FindFiles(dataFolder string, logger *koan.Logger) ([]string, error)
- func InitDatasource(file string) internal.Datasource
- func LoadAndValidate(ds internal.Datasource, logger *koan.Logger) (internal.Datasource, error)
- func LoadAndValidateDatasources(dataFolder string, logger *koan.Logger) (map[string]internal.Datasource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFiles ¶
FindFiles identifies all JSON and CSV files in the target dataFolder, files which are not JSON or CSV (as determined by the extension) will be skipped but logged
func InitDatasource ¶
func InitDatasource(file string) internal.Datasource
InitDatasource create a Datasource type and partially configures it with known info about the datasource
func LoadAndValidate ¶
func LoadAndValidate(ds internal.Datasource, logger *koan.Logger) (internal.Datasource, error)
LoadAndValidate performs the load and validation at the individual datasource level for both JSON and CSV file formats, it also logs non fatal warnings and errors which may prevent proper parsing of a datasource
func LoadAndValidateDatasources ¶
func LoadAndValidateDatasources(dataFolder string, logger *koan.Logger) (map[string]internal.Datasource, error)
LoadAndValidateDatasources finds, loads and validates all data at application startup
Types ¶
This section is empty.