func NewPluginConfig(errorHandler func(error)) *PluginConfig { pluginPath := filepath.Join(config_helpers.PluginRepoDir(), ".cf", "plugins") return &PluginConfig{ data: NewData(), mutex: new(sync.RWMutex), initOnce: new(sync.Once), persistor: configuration.NewDiskPersistor(filepath.Join(pluginPath, "config.json")), onError: errorHandler, pluginPath: pluginPath, } }
func NewRepositoryFromFilepath(filepath string, errorHandler func(error)) Repository { return NewRepositoryFromPersistor(configuration.NewDiskPersistor(filepath), errorHandler) }