Documentation ¶
Index ¶
- Constants
- Variables
- func BuildCredentials(subdomainOrBaseURL, token string) goauth.Credentials
- func NewClient(subdomain, token string) (*http.Client, error)
- func NewEndpoint(subdomain string) oauth2.Endpoint
- func NewSimpleClient(subdomain, token string) (*httpsimple.Client, error)
- type AhaUserinfo
- type AhaUserinfoWrap
- type ClientUtil
Constants ¶
View Source
const ( APIMeURL = "https://secure.aha.io/api/v1/me" // no longer supported by Aha. Must use sub-domain BaseURLFormat = "https://%s.aha.io/" APIMeURLFormat = "https://%s.aha.io/api/v1/me" APIMeURLPath = "/api/v1/me" AuthURLFormat = "https://%s.aha.io/oauth/authorize" TokenURLFormat = "https://%s.aha.io/oauth/token" // #nosec G101 AhaAccountHeader = "X-AHA-ACCOUNT" )
Variables ¶
View Source
var ( AhaAccountEnv = "AHA_ACCOUNT" AhaServerURL = "AHA_SERVER_URL" AhaAPIKeyEnv = "AHA_API_KEY" // #nosec G101 )
Functions ¶
func BuildCredentials ¶ added in v0.21.0
func BuildCredentials(subdomainOrBaseURL, token string) goauth.Credentials
func NewEndpoint ¶
func NewSimpleClient ¶ added in v0.21.0
func NewSimpleClient(subdomain, token string) (*httpsimple.Client, error)
Types ¶
type AhaUserinfo ¶
type AhaUserinfoWrap ¶
type AhaUserinfoWrap struct {
User *AhaUserinfo `json:"user,omitempty"`
}
type ClientUtil ¶
type ClientUtil struct { Client *http.Client SimpleClient *httpsimple.Client User *AhaUserinfo `json:"user,omitempty"` }
ClientUtil is a client library to retrieve user info from the Facebook API.
func NewClientUtil ¶
func NewClientUtil(client *http.Client) ClientUtil
func (*ClientUtil) GetSCIMUser ¶
func (apiutil *ClientUtil) GetSCIMUser() (scim.User, error)
func (*ClientUtil) GetUserinfo ¶
func (apiutil *ClientUtil) GetUserinfo() (*AhaUserinfo, error)
GetUserinfo retrieves the userinfo from the https://graph.facebook.com/v2.9/{user-id} endpoint.
func (*ClientUtil) SetClient ¶
func (apiutil *ClientUtil) SetClient(client *http.Client)
func (*ClientUtil) SetSimpleClient ¶ added in v0.21.0
func (apiutil *ClientUtil) SetSimpleClient(sclient *httpsimple.Client)
Click to show internal directories.
Click to hide internal directories.