NewOAuthServer creates a new OAuth callback server. It initializes the server with the specified port and creates channels for handling OAuth results and errors. Parameters: - port: The port number on which the server should listen Returns: - *OAuthServer: A new OAuthServer instance
(port int)
| 56 | // Returns: |
| 57 | // - *OAuthServer: A new OAuthServer instance |
| 58 | func NewOAuthServer(port int) *OAuthServer { |
| 59 | return &OAuthServer{ |
| 60 | port: port, |
| 61 | resultChan: make(chan *OAuthResult, 1), |
| 62 | errorChan: make(chan error, 1), |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // Start starts the OAuth callback server. |
| 67 | // It sets up the HTTP handlers for the callback and success endpoints, |