2021-07-23 18:55:53 +00:00
|
|
|
package dns
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
|
|
|
)
|
|
|
|
|
|
2021-07-23 18:57:29 +00:00
|
|
|
type StatusGetterApplier interface {
|
|
|
|
|
StatusGetter
|
|
|
|
|
StatusApplier
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type StatusGetter interface {
|
|
|
|
|
GetStatus() (status models.LoopStatus)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (l *Loop) GetStatus() (status models.LoopStatus) { return l.state.GetStatus() }
|
2021-07-23 18:55:53 +00:00
|
|
|
|
|
|
|
|
type StatusApplier interface {
|
|
|
|
|
ApplyStatus(ctx context.Context, status models.LoopStatus) (
|
|
|
|
|
outcome string, err error)
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-23 18:57:29 +00:00
|
|
|
func (l *Loop) ApplyStatus(ctx context.Context, status models.LoopStatus) (
|
2021-07-23 18:55:53 +00:00
|
|
|
outcome string, err error) {
|
|
|
|
|
return l.state.ApplyStatus(ctx, status)
|
|
|
|
|
}
|