2021-07-23 20:41:45 +00:00
|
|
|
package state
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
|
|
"github.com/qdm12/gluetun/internal/configuration"
|
|
|
|
|
"github.com/qdm12/gluetun/internal/loopstate"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var _ Manager = (*State)(nil)
|
|
|
|
|
|
|
|
|
|
type Manager interface {
|
2021-07-24 19:49:50 +00:00
|
|
|
SettingsGetSetter
|
2021-07-23 20:41:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func New(statusApplier loopstate.Applier,
|
|
|
|
|
settings configuration.HTTPProxy) *State {
|
|
|
|
|
return &State{
|
|
|
|
|
statusApplier: statusApplier,
|
|
|
|
|
settings: settings,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type State struct {
|
|
|
|
|
statusApplier loopstate.Applier
|
|
|
|
|
settings configuration.HTTPProxy
|
|
|
|
|
settingsMu sync.RWMutex
|
|
|
|
|
}
|