-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
triageThe issue needs triaging.The issue needs triaging.
Description
Background
Gofr support remote log level configuration. This can be extended to allow remote updating other configurations as well.
Proposal
A new interface which can be implemented by any receiver which supports reloading based on configuration at runtime. Remote Config
High level implementation as below:
// structs implementing RemoteConfigurable interface are responsible to update/reload the internal config and make it available in-place, i.e. not require restarting the application
type RemoteConfigurable interface {
refreshConfig(config map[string]string) error
}
type RemoteConfiguration interface {
registerReceiver(receiver RemoteConfigurable) bool
fetchRemoteConfig() error
}
// TODO: this can be moved to a common package as it's used in other places like JWKS fetch as well
// TODO: better name can be given for this interface
type HTTPGetProvider interface {
GetWithHeaders(ctx context.Context, path string, queryParams map[string]any,
headers map[string]string) (*http.Response, error)
}
// GofrRemoteConfig implements RemoteConfiguration interface
type GofrRemoteConfig struct {
provider HTTPGetProvider
receivers RemoteConfigurable
// refreshFrequency configuration
}
Metadata
Metadata
Assignees
Labels
triageThe issue needs triaging.The issue needs triaging.