Documentation ¶
Index ¶
- type Config
- type Manager
- func (oauth2Manager Manager) Authorize(w http.ResponseWriter, r *http.Request)
- func (oauth2Manager Manager) AuthorizeCallback(w http.ResponseWriter, r *http.Request)
- func (oauth2Manager Manager) GetClient(r *http.Request) *http.Client
- func (oauth2Manager Manager) GetClientFromAccessToken(accessToken string) *http.Client
- func (oauth2Manager Manager) GetSessionAccessToken(r *http.Request) string
- func (oauth2Manager Manager) Logout(w http.ResponseWriter, r *http.Request)
- func (oauth2Manager Manager) SetSessionAccessToken(accessToken string, w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
Manager type. Manager to handle an OAuth2 session. OAuth2 is required to invoke the GitHub APIs on behalf the user.
func NewManager ¶
NewManager is the constructor for OAuth2 Manager.
func (Manager) Authorize ¶
func (oauth2Manager Manager) Authorize(w http.ResponseWriter, r *http.Request)
Authorize to request for OAuth2 authorization against GitHub.
func (Manager) AuthorizeCallback ¶
func (oauth2Manager Manager) AuthorizeCallback(w http.ResponseWriter, r *http.Request)
AuthorizeCallback to handle the authorize callback from GitHub.
func (Manager) GetClient ¶
GetClient to set up an OAuth2 HTTP client able to access GitHub APIs. The access token is obtained from the session.
func (Manager) GetClientFromAccessToken ¶
GetClientFromAccessToken to set up an OAuth2 HTTP client able to access GitHub APIs. The access token is passed as a parameter.
func (Manager) GetSessionAccessToken ¶
GetSessionAccessToken to get the OAuth2 access token from the session.
func (Manager) Logout ¶
func (oauth2Manager Manager) Logout(w http.ResponseWriter, r *http.Request)
Logout to destroy the session.
func (Manager) SetSessionAccessToken ¶
func (oauth2Manager Manager) SetSessionAccessToken(accessToken string, w http.ResponseWriter, r *http.Request)
SetSessionAccessToken to store the OAuth2 access token in the session