libkv icon indicating copy to clipboard operation
libkv copied to clipboard

generic configuration?

Open odedlaz opened this issue 9 years ago • 1 comments

I want to implement a new vault backend. The issue is that vault needs a lot of extra configuration that conventional key-value stores don't need.

I think we need to move from a base struct that each backend uses, to a loosely-typed config json that will be unmarshled by the backend itself and not the generic store.

I'll happily do this if you think that's the right move. Thoughts?

odedlaz avatar Mar 31 '16 16:03 odedlaz

Maybe something like docker registry uses to initialize its storage driver? Unmarshal the parameters into a map[string]interface{} and the driver's factory func handles verifying the correct values are provided.

func (f *driverFactory) Create(parameters map[string]interface{}) (storage.Driver, error) {
    // ....
}

danielkrainas avatar Oct 18 '16 16:10 danielkrainas