file

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package file performs operations related to file discovery, validation, conversion and load to the cache

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFiles

func FindFiles(dataFolder string, logger *koan.Logger) ([]string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL