chore(config): define Source interface locally where needed
This commit is contained in:
3
internal/configuration/sources/env/reader.go
vendored
3
internal/configuration/sources/env/reader.go
vendored
@@ -2,11 +2,8 @@ package env
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/configuration/sources"
|
||||
)
|
||||
|
||||
var _ sources.Source = (*Reader)(nil)
|
||||
|
||||
type Reader struct {
|
||||
warner Warner
|
||||
}
|
||||
|
||||
@@ -2,11 +2,8 @@ package files
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/configuration/sources"
|
||||
)
|
||||
|
||||
var _ sources.Source = (*Reader)(nil)
|
||||
|
||||
type Reader struct{}
|
||||
|
||||
func New() *Reader {
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -2,13 +2,9 @@ package secrets
|
||||
|
||||
import (
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/configuration/sources"
|
||||
)
|
||||
|
||||
var _ sources.Source = (*Reader)(nil)
|
||||
|
||||
type Reader struct {
|
||||
}
|
||||
type Reader struct{}
|
||||
|
||||
func New() *Reader {
|
||||
return &Reader{}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package sources
|
||||
|
||||
import "github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
|
||||
type Source interface {
|
||||
Read() (settings settings.Settings, err error)
|
||||
ReadHealth() (settings settings.Health, err error)
|
||||
String() string
|
||||
}
|
||||
Reference in New Issue
Block a user