diff --git a/management/server/geolocation/geolocation.go b/management/server/geolocation/geolocation.go index f209cc715..b1d7e7b93 100644 --- a/management/server/geolocation/geolocation.go +++ b/management/server/geolocation/geolocation.go @@ -21,7 +21,7 @@ type Geolocation interface { Stop() error } -type GeolocationImpl struct { +type geolocationImpl struct { mmdbPath string mux sync.RWMutex db *maxminddb.Reader @@ -93,7 +93,7 @@ func NewGeolocation(ctx context.Context, dataDir string, autoUpdate bool) (Geolo return nil, err } - geo := &GeolocationImpl{ + geo := &geolocationImpl{ mmdbPath: mmdbPath, mux: sync.RWMutex{}, db: db, @@ -120,7 +120,7 @@ func openDB(mmdbPath string) (*maxminddb.Reader, error) { return db, nil } -func (gl *GeolocationImpl) Lookup(ip net.IP) (*Record, error) { +func (gl *geolocationImpl) Lookup(ip net.IP) (*Record, error) { gl.mux.RLock() defer gl.mux.RUnlock() @@ -134,7 +134,7 @@ func (gl *GeolocationImpl) Lookup(ip net.IP) (*Record, error) { } // GetAllCountries retrieves a list of all countries. -func (gl *GeolocationImpl) GetAllCountries() ([]Country, error) { +func (gl *geolocationImpl) GetAllCountries() ([]Country, error) { allCountries, err := gl.locationDB.GetAllCountries() if err != nil { return nil, err @@ -150,7 +150,7 @@ func (gl *GeolocationImpl) GetAllCountries() ([]Country, error) { } // GetCitiesByCountry retrieves a list of cities in a specific country based on the country's ISO code. -func (gl *GeolocationImpl) GetCitiesByCountry(countryISOCode string) ([]City, error) { +func (gl *geolocationImpl) GetCitiesByCountry(countryISOCode string) ([]City, error) { allCities, err := gl.locationDB.GetCitiesByCountry(countryISOCode) if err != nil { return nil, err @@ -165,7 +165,7 @@ func (gl *GeolocationImpl) GetCitiesByCountry(countryISOCode string) ([]City, er return cities, nil } -func (gl *GeolocationImpl) Stop() error { +func (gl *geolocationImpl) Stop() error { close(gl.stopCh) if gl.db != nil { if err := gl.db.Close(); err != nil { diff --git a/management/server/geolocation/geolocation_test.go b/management/server/geolocation/geolocation_test.go index 1980e32fc..fecd715be 100644 --- a/management/server/geolocation/geolocation_test.go +++ b/management/server/geolocation/geolocation_test.go @@ -24,7 +24,7 @@ func TestGeoLite_Lookup(t *testing.T) { db, err := openDB(filename) assert.NoError(t, err) - geo := &GeolocationImpl{ + geo := &geolocationImpl{ mux: sync.RWMutex{}, db: db, stopCh: make(chan struct{}), diff --git a/management/server/jwtclaims/jwtValidator.go b/management/server/jwtclaims/jwtValidator.go index ab43c7fe9..b7b05d5e2 100644 --- a/management/server/jwtclaims/jwtValidator.go +++ b/management/server/jwtclaims/jwtValidator.go @@ -76,8 +76,8 @@ type JWTValidator interface { ValidateAndParse(ctx context.Context, token string) (*jwt.Token, error) } -// JWTValidatorImpl struct to handle token validation and parsing -type JWTValidatorImpl struct { +// jwtValidatorImpl struct to handle token validation and parsing +type jwtValidatorImpl struct { options Options } @@ -142,13 +142,13 @@ func NewJWTValidator(ctx context.Context, issuer string, audienceList []string, options.UserProperty = "user" } - return &JWTValidatorImpl{ + return &jwtValidatorImpl{ options: options, }, nil } // ValidateAndParse validates the token and returns the parsed token -func (m *JWTValidatorImpl) ValidateAndParse(ctx context.Context, token string) (*jwt.Token, error) { +func (m *jwtValidatorImpl) ValidateAndParse(ctx context.Context, token string) (*jwt.Token, error) { // If the token is empty... if token == "" { // Check if it was required