fix compile errors

This commit is contained in:
2025-04-10 12:06:24 +02:00
parent 5b0b555557
commit 1306939d58

View File

@@ -7,6 +7,8 @@ import (
"crypto/tls"
"errors"
"fmt"
"sync"
"strings"
"net/http"
"net/http/cookiejar"
"os"
@@ -78,11 +80,11 @@ func CreateUnifiClient() (*UnifiClient, error) {
return unifiClient, nil
}
func (s *Session) WithSession(action func(c *unifi.Client) error) error {
func (s *UnifiClient) WithSession(action func(c *unifi.Client) error) error {
s.mutex.Lock()
defer s.mutex.Unlock()
err := action(s.client)
err := action(s.Client)
if err == nil {
return nil
}
@@ -94,9 +96,10 @@ func (s *Session) WithSession(action func(c *unifi.Client) error) error {
return action(s.Client)
}
return err
}
func isSessionExpired(err error) bool {
func IsSessionExpired(err error) bool {
if err == nil {
return false
}