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)
| 53 | // Returns: |
| 54 | // - *OAuthServer: A new OAuthServer instance |
| 55 | func NewOAuthServer(port int) *OAuthServer { |
| 56 | return &OAuthServer{ |
| 57 | port: port, |
| 58 | resultChan: make(chan *OAuthResult, 1), |
| 59 | errorChan: make(chan error, 1), |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | // Start starts the OAuth callback server. |
| 64 | // It sets up the HTTP handlers for the callback and success endpoints, |