Documentation
¶
Index ¶
Constants ¶
const ( AddressS = "address" QtyPurchasedS = "qty_purchased" PurchaseDateS = "purchase_date" UnlockDateS = "unlock_date" NotifyImmediatelyS = "notify_immediately" RewardTargetS = "reward_target" DelegationNodeS = "delegation_node" RecourseS = "recourse_period" RewardSourceS = "reward_source" ValidationPublic1S = "validation_public_1" ValidationPublic2S = "validation_public_2" ValidationScriptS = "validation_script" )
each column needs a const string identifier
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns the default path at which a config file is expected
func WithConfig ¶
WithConfig wraps configuration editing.
It reads the config file from the specified path, creating a default if necessary. It then calls the provided function with that configuration. If the provided function returns without error, it writes the new configuration to the same path.
Types ¶
type ColumnMap ¶
ColumnMap is the map of column names to indices
This permits us not to worry about the headers, and instead simply fetch the desired columns directly.
type Config ¶
type Config struct { Path string `toml:"path"` Sheet string `toml:"sheet"` Columns ColumnMap `toml:"columns"` FirstRow int `toml:"first_row"` NomsPath string `toml:"noms_path"` GenesisToml string `toml:"genesis_toml"` }
Config is the configuration data used by ETL
func DefaultConfig ¶
DefaultConfig creates a default config struct
func LoadConfig ¶
LoadConfig returns a config object loaded from its file
func LoadDefaultConfig ¶
LoadDefaultConfig returns a config object loaded from its file
If the file does not exist, a default is transparently created
func (*Config) CheckColumns ¶
CheckColumns verifies that all expected columns are present