Documentation ¶
Index ¶
- Constants
- type Auth
- type AuthCallResponseData
- type Platform
- func (p *Platform) APICall(ctx context.Context, req httpsimple.Request) (*http.Response, error)
- func (p *Platform) APIURL(url string) string
- func (p *Platform) Authorize(ctx context.Context, username string, extension string, password string, ...) (*http.Response, error)
- func (p *Platform) Delete(url string, queryParameters url.Values, body io.Reader, headers http.Header) (*http.Response, error)
- func (p *Platform) Get(url string, queryParameters url.Values, body io.Reader, headers http.Header) (*http.Response, error)
- func (p *Platform) GetApiKey() string
- func (p *Platform) GetAuthHeader() string
- func (p *Platform) IsAuthorized() *Platform
- func (p *Platform) Post(url string, queryParameters url.Values, body io.Reader, headers http.Header) (*http.Response, error)
- func (p *Platform) Put(url string, queryParameters url.Values, body io.Reader, headers http.Header) (*http.Response, error)
- func (p *Platform) Send(req rchttp.Request) (*http.Response, error)
Constants ¶
View Source
const ( AccessTokenTTL int = 3600 RefreshTokenTTL int = 36000 // 10 hours RefreshTokenTTLRemember int = 604800 // 1 week AccountPrefix string = "/account/" AccountID string = "~" TokenEndpoint string = "/restapi/oauth/token" // #nosec G101 RevokeEndpoint string = "/restapi/oauth/revoke" APIVersion string = "v1.0" URLPrefix string = "/restapi" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) GetAccessToken ¶
func (*Auth) GetTokenType ¶
func (*Auth) SetData ¶
func (a *Auth) SetData(authData AuthCallResponseData) *Auth
type AuthCallResponseData ¶
type AuthCallResponseData struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` RefreshToken string `json:"refresh_token"` RefreshTokenExpiresIn int `json:"refresh_token_expires_in"` Scope string `json:"scope"` OwnerId string `json:"owner_id"` }
func NewAuthCallResponseData ¶
func NewAuthCallResponseData(body []byte) (AuthCallResponseData, error)
type Platform ¶
type Platform struct { Auth Auth // contains filtered or unexported fields }
func NewPlatform ¶
func (*Platform) GetAuthHeader ¶
func (*Platform) IsAuthorized ¶
Click to show internal directories.
Click to hide internal directories.