Skip to content

Conversation

@L4B0MB4
Copy link
Contributor

@L4B0MB4 L4B0MB4 commented Dec 2, 2024

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:

  • Added WebsocketConnection and WSController classes to handle WebSocket connections, including authentication and connection management (pkg/websocket/websocket_connection.go, pkg/websocket/websocket_controller.go). [1] [2]
  • Introduced WebsocketConnecter interface to define methods for WebSocket connections (pkg/interfaces/websocket_connector.go).

Token Creation Updates:

  • Modified CreateToken function to accept a duration parameter, allowing for customizable token expiration times (pkg/auth/token_manager.go). [1] [2]
  • Updated tests to reflect changes in the CreateToken function (pkg/auth/token_manager_test.go). [1] [2]

Event Handling Refactor:

  • Refactored EventHandler interface and moved it to the interfaces package (pkg/interfaces/event_handler.go).
  • Updated EventPolling to use the new EventHandler interface (pkg/eventpolling/polling.go).
  • Removed the old EventHanlder interface (pkg/eventpolling/event_handler.go).

Dependencies:

  • Added github.com/gorilla/websocket to the go.mod file 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.

…ds for authentication and connection status, improving encapsulation and code clarity
…expiration, enhancing flexibility in token management
@L4B0MB4 L4B0MB4 merged commit 1b6923d into main Dec 2, 2024
2 checks passed
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.

2 participants