Documentation
¶
Overview ¶
Package oauth provides OAuth callback server implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallbackServer ¶
type CallbackServer struct {
// contains filtered or unexported fields
}
CallbackServer implements the OAuth callback server.
func NewCallbackServer ¶
func NewCallbackServer(port int) *CallbackServer
NewCallbackServer creates a new callback server.
func (*CallbackServer) GetRedirectURI ¶
func (s *CallbackServer) GetRedirectURI() string
GetRedirectURI returns the redirect URI for OAuth.
func (*CallbackServer) Start ¶
func (s *CallbackServer) Start() error
Start starts the callback server.
func (*CallbackServer) WaitForCallback ¶
func (s *CallbackServer) WaitForCallback(ctx context.Context) (string, error)
WaitForCallback waits for the OAuth callback and returns the auth code.
type MockServer ¶
type MockServer struct {
Port int
AuthCode string
StartCalled bool
StopCalled bool
WaitForCallbackCalled bool
TimeoutAfter time.Duration
}
MockServer is a mock implementation of OAuthServer for testing.
func NewMockServer ¶
func NewMockServer(authCode string) *MockServer
NewMockServer creates a new MockServer.
func (*MockServer) GetRedirectURI ¶
func (m *MockServer) GetRedirectURI() string
GetRedirectURI returns the redirect URI.
func (*MockServer) WaitForCallback ¶
func (m *MockServer) WaitForCallback(ctx context.Context) (string, error)
WaitForCallback waits for the OAuth callback.
Click to show internal directories.
Click to hide internal directories.