chore(config): rename Reader to Source struct

This commit is contained in:
Quentin McGaw
2022-08-26 15:16:51 +00:00
parent ae5cba519c
commit 8570e09eb9
28 changed files with 205 additions and 205 deletions

View File

@@ -7,13 +7,13 @@ import (
"github.com/qdm12/gluetun/internal/configuration/settings"
)
func (r *Reader) readPublicIP() (publicIP settings.PublicIP, err error) {
func (s *Source) readPublicIP() (publicIP settings.PublicIP, err error) {
publicIP.Period, err = readPublicIPPeriod()
if err != nil {
return publicIP, err
}
publicIP.IPFilepath = r.readPublicIPFilepath()
publicIP.IPFilepath = s.readPublicIPFilepath()
return publicIP, nil
}
@@ -33,10 +33,10 @@ func readPublicIPPeriod() (period *time.Duration, err error) {
return period, nil
}
func (r *Reader) readPublicIPFilepath() (filepath *string) {
_, s := r.getEnvWithRetro("PUBLICIP_FILE", "IP_STATUS_FILE")
if s != "" {
return &s
func (s *Source) readPublicIPFilepath() (filepath *string) {
_, value := s.getEnvWithRetro("PUBLICIP_FILE", "IP_STATUS_FILE")
if value != "" {
return &value
}
return nil
}