Maint: loopstate package used in Openvpn state

This commit is contained in:
Quentin McGaw (desktop)
2021-07-23 20:41:45 +00:00
parent fa6ccb08bd
commit 253310bd1a
16 changed files with 374 additions and 218 deletions

14
internal/loopstate/get.go Normal file
View File

@@ -0,0 +1,14 @@
package loopstate
import "github.com/qdm12/gluetun/internal/models"
type Getter interface {
GetStatus() (status models.LoopStatus)
}
// GetStatus gets the status thread safely.
func (s *State) GetStatus() (status models.LoopStatus) {
s.statusMu.RLock()
defer s.statusMu.RUnlock()
return s.status
}