handle before/after inside config implementations

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-18 03:37:18 +03:00
parent f6c0728a59
commit 8c504bd029
2 changed files with 35 additions and 0 deletions

View File

@@ -40,3 +40,14 @@ type Config interface {
// Next() (, error)
// Stop() error
//}
// Load loads config from config sources
func Load(ctx context.Context, cs ...Config) error {
var err error
for _, c := range cs {
if err = c.Load(ctx); err != nil {
return err
}
}
return nil
}