Documentation ¶
Index ¶
- Variables
- func DefaultBuild() module.Invoker
- type Client
- func (c *Client) GetAccessToken(state, code string, option ...oauth2.AuthCodeOption) (token *oauth2.Token, err error)
- func (c *Client) GetCfg() InvokerCfg
- func (c *Client) GetUserInfo(token *oauth2.Token, info interface{}) (user interface{}, err error)
- func (c *Client) LoginPage(option ...oauth2.AuthCodeOption) string
- type InvokerCfg
- type OAuthService
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultInvokerCfg = InvokerCfg{ Debug: false, AppID: "", AppSecret: "", RedirectURI: "", AuthURL: "", TokenURL: "", State: "", UserInfoURL: "", Scopes: nil, }
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetAccessToken ¶
func (*Client) GetCfg ¶
func (c *Client) GetCfg() InvokerCfg
func (*Client) GetUserInfo ¶
type InvokerCfg ¶
type InvokerCfg struct { Debug bool `ini:"debug"` AppID string `ini:"appId"` AppSecret string `ini:"appSecret"` RedirectURI string `ini:"redirectUri"` AuthURL string `ini:"authUrl"` TokenURL string `ini:"tokenUrl"` State string `ini:"state"` UserInfoURL string `ini:"userInfoUrl"` Scopes []string `ini:"scopes"` }
type OAuthService ¶
type OAuthService interface { LoginPage(option ...oauth2.AuthCodeOption) string GetAccessToken(state, code string, option ...oauth2.AuthCodeOption) (token *oauth2.Token, err error) GetUserInfo(token *oauth2.Token, info interface{}) (user interface{}, err error) GetCfg() InvokerCfg }
Click to show internal directories.
Click to hide internal directories.