chore(config): define Source interface locally where needed

This commit is contained in:
Quentin McGaw
2022-08-26 15:03:59 +00:00
parent 26f3832187
commit ae5cba519c
8 changed files with 24 additions and 27 deletions

View File

@@ -5,16 +5,19 @@ import (
"strings"
"github.com/qdm12/gluetun/internal/configuration/settings"
"github.com/qdm12/gluetun/internal/configuration/sources"
)
var _ sources.Source = (*Reader)(nil)
type Reader struct {
sources []sources.Source
type Source interface {
Read() (settings settings.Settings, err error)
ReadHealth() (settings settings.Health, err error)
String() string
}
func New(sources ...sources.Source) *Reader {
type Reader struct {
sources []Source
}
func New(sources ...Source) *Reader {
return &Reader{
sources: sources,
}