turbot / steampipe

Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
https://steampipe.io
GNU Affero General Public License v3.0
6.92k stars 274 forks source link

Migrate all json config files to use snake case property names #1730

Closed kaidaguerre closed 2 years ago

kaidaguerre commented 2 years ago

John Smyth:

That is our 'standard' for the steampipe cloud api.  It seems like we have a mix in steampipe today - versions.json and update-check.json are lowerCamel, plugin_manager.json and steampipe.json are UpperCamel...  Not urgent, but we should probably migrate to a standard format.

We should also look at updating the names for consistency of - vs _ (see also https://github.com/turbot/steampipe/issues/402) Files to update:

versions.json
update-check.json
plugin_manager.json
steampipe.json
.mod.cache.json
kaidaguerre commented 2 years ago
type Migrateable interface{
      MigrateFrom(old interface{})
}

func Migrate(old interface{}, new Migrateable, filepath)Migrateable{
     // deserialise into new
     if structVersion == expected{ return}

     // deserialise into old
     new.MigrateFrom(old)

   // serialise to file
     return new
}