big progress checkin. Still quite broken, but now it shows the new direction. Time to start hooking things up again.

This commit is contained in:
Dave Lee 2023-06-01 20:44:54 -04:00
parent 20a0cd2f66
commit f9133b5a61
No known key found for this signature in database
12 changed files with 228 additions and 364 deletions

View file

@ -43,6 +43,18 @@ type Config interface {
GetRegistration() ConfigRegistration
}
func (cs ConfigStub) GetRequestDefaults() interface{} {
return nil
}
func (cs ConfigStub) GetLocalPaths() ConfigLocalPaths {
return cs.LocalPaths
}
func (cs ConfigStub) GetRegistration() ConfigRegistration {
return cs.Registration
}
func (sc SpecificConfig[RequestModel]) GetRequestDefaults() interface{} {
return sc.RequestDefaults
}
@ -158,6 +170,17 @@ func (cm *ConfigManager) GetConfig(r ConfigRegistration) (Config, bool) {
return v, exists
}
// This is a convience function for endpoint functions to use.
// The advantage is it avoids errors in the endpoint string
// Not a clue what the performance cost of this is.
func (cm *ConfigManager) GetConfigForThisEndpoint(m string) (Config, bool) {
endpoint := printCurrentFunctionName(2)
return cm.GetConfig(ConfigRegistration{
Model: m,
Endpoint: endpoint,
})
}
func (cm *ConfigManager) listConfigs() []ConfigRegistration {
var res []ConfigRegistration
for k := range cm.configs {