diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-02 03:14:47 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-02 03:14:47 -0500 |
commit | d078f6dc10eb265a5d88cd96adf86173d6d3ba2e (patch) | |
tree | ed8bc2405b60b2ae31405c3d8e27b24fda3ac003 /config.go | |
parent | 96701f87a114557f1a013229e889b4b726aa7dc1 (diff) | |
download | planr-d078f6dc10eb265a5d88cd96adf86173d6d3ba2e.tar.xz planr-d078f6dc10eb265a5d88cd96adf86173d6d3ba2e.zip |
Make adapters and internals complient with new directory structure
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 33 |
1 files changed, 0 insertions, 33 deletions
@@ -1,11 +1,8 @@ package planr import ( - "log" "github.com/BurntSushi/toml" ) - - /* TODO: Every property defined within the defaults currently has to implement the "inherit" method to conditionally inherit a @@ -38,22 +35,6 @@ type InheritableConfig interface { Inherit(parent interface{}) } -// A parser function takes a blob of TOML and decodes it into -// configuration relevant to an adapter -type TomlParser func (toml.Primitive) (InheritableConfig, error) - -// The name under which an adapter registers corresponds -// to a table under the super-table adapters. All corresponding -// TOML will be passed to the ParseConfig method or ParseDefaultConfig -// for parsing. The ParseConfig file parses options in test case files. -// The ParseDefaultConfig is parsed by `defaults.toml` files and can -// be used to establish default configuration that will be inherited -// by all units in a common directory (collection) -type AdapterConfig struct { - Name string - ParseConfig TomlParser - ParseDefaultConfig TomlParser -} // Program-wide configuration which is recognized // in defaults.toml @@ -82,18 +63,6 @@ type Defaults struct { configs_ *[]AdapterConfig } -// Program-wide testcase config -type TestCaseConfig struct { - Defaults - Title *string - Description *string -} - -func (c TestCaseConfig) ensureSatisfied(name string) { - if (c.Adapter == nil) { - log.Fatalf("Adapter must be provided for testcase %s", name) - } -} // The default configuration must be able in inherit from // other defaults further up the tree @@ -169,8 +138,6 @@ func (defaults *Defaults) decodeAdapters( func DecodeDefaults(path string, adapterCfg []AdapterConfig) (Defaults, error) { defaults := Defaults { } - - if _, err := toml.DecodeFile(path, &defaults); err != nil { return defaults, err } |