Skip to content

Add individual endpoints package to split the definition#34

Open
Janni2006 wants to merge 16 commits intodevelopmentfrom
package_split_endpoints
Open

Add individual endpoints package to split the definition#34
Janni2006 wants to merge 16 commits intodevelopmentfrom
package_split_endpoints

Conversation

@Janni2006
Copy link
Copy Markdown
Contributor

This pull request refactors the application's configuration and endpoint handling by modularizing configuration logic and HTTP endpoints into dedicated packages. The main application logic in main.go is significantly simplified, with all API endpoints moved to internal/endpoints.

This depends on #33 for splitting configuration into another file.

The most important changes are:

Endpoint Modularization

  • Moved all API endpoint handlers (/status, /calendar, /network_info, /config) into the new internal/endpoints package, with each endpoint implemented in a separate file for clarity and reusability. The router setup now delegates endpoint registration to endpoints.ApiRouter. (internal/endpoints/router.go, internal/endpoints/status.go, internal/endpoints/calendar.go, internal/endpoints/network.go)

Main Application Simplification

  • Removed all endpoint logic, configuration struct definitions, and configuration loading code from main.go. The main file now focuses on initializing the application, delegating routing to the new package. (main.go)

Type and Structure Improvements

  • Centralized and clarified all relevant data models (e.g., for events, network status, display config) in the appropriate packages, reducing duplication and potential for inconsistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant