Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to the codebase, primarily focusing on the addition of WebSocket functionality, modifications to the token creation process, and refactoring of event handling interfaces. The most important changes include the introduction of WebSocket connection handling, updates to the token creation method to include a duration parameter, and the refactoring of the event handler interface.
WebSocket Functionality:
WebsocketConnectionandWSControllerclasses to handle WebSocket connections, including authentication and connection management (pkg/websocket/websocket_connection.go,pkg/websocket/websocket_controller.go). [1] [2]WebsocketConnecterinterface to define methods for WebSocket connections (pkg/interfaces/websocket_connector.go).Token Creation Updates:
CreateTokenfunction to accept adurationparameter, allowing for customizable token expiration times (pkg/auth/token_manager.go). [1] [2]CreateTokenfunction (pkg/auth/token_manager_test.go). [1] [2]Event Handling Refactor:
EventHandlerinterface and moved it to theinterfacespackage (pkg/interfaces/event_handler.go).EventPollingto use the newEventHandlerinterface (pkg/eventpolling/polling.go).EventHanlderinterface (pkg/eventpolling/event_handler.go).Dependencies:
github.com/gorilla/websocketto thego.modfile to support WebSocket connections (go.mod).These changes collectively enhance the system's capability to handle WebSocket connections, provide more flexibility in token management, and improve the structure and clarity of event handling within the codebase.