Maint: loopstate package used in Openvpn state
This commit is contained in:
16
internal/loopstate/set.go
Normal file
16
internal/loopstate/set.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package loopstate
|
||||
|
||||
import "github.com/qdm12/gluetun/internal/models"
|
||||
|
||||
type Setter interface {
|
||||
SetStatus(status models.LoopStatus)
|
||||
}
|
||||
|
||||
// SetStatus sets the status thread safely.
|
||||
// It should only be called by the loop internal code since
|
||||
// it does not interact with the loop code directly.
|
||||
func (s *State) SetStatus(status models.LoopStatus) {
|
||||
s.statusMu.Lock()
|
||||
defer s.statusMu.Unlock()
|
||||
s.status = status
|
||||
}
|
||||
Reference in New Issue
Block a user