Fixed linter errors and fixed tests
- Added error handling for JSON encoding in ServersHandler and ServersDetailHandler. - Updated test cases to reflect changes in handler functions and improved mock expectations. - Refactored server initialization to include ReadHeaderTimeout for better request handling. - Modified GitHubDeviceAuth to accept context in ValidateToken and checkOrgMembership methods. - Improved error messages in database import functions for better debugging. - Updated memory and mongo database list functions to accept context and improved filtering logic. - Enhanced logging in publisher tool for better visibility during execution. - Cleaned up code formatting and comments for better readability and maintainability.
This commit is contained in:
parent
c74a7af000
commit
b6c141a721
2 changed files with 317 additions and 225 deletions
|
|
@ -15,6 +15,8 @@ type fakeRegistryService struct {
|
|||
}
|
||||
|
||||
// NewFakeRegistryService creates a new fake registry service with pre-populated data
|
||||
//
|
||||
//nolint:ireturn // Factory function intentionally returns interface for dependency injection
|
||||
func NewFakeRegistryService() RegistryService {
|
||||
// Sample registry entries with updated model structure
|
||||
registries := []*model.Server{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ type registryServiceImpl struct {
|
|||
}
|
||||
|
||||
// NewRegistryServiceWithDB creates a new registry service with the provided database
|
||||
//
|
||||
//nolint:ireturn // Factory function intentionally returns interface for dependency injection
|
||||
func NewRegistryServiceWithDB(db database.Database) RegistryService {
|
||||
return ®istryServiceImpl{
|
||||
db: db,
|
||||
|
|
|
|||
Loading…
Reference in a new issue