Documentation ¶
Index ¶
- Constants
- type Auth
- type AuthCallResponseData
- type Platform
- func (p *Platform) APICall(req rchttp.Request2) (*http.Response, error)
- func (p *Platform) ApiUrl(url string) string
- func (p *Platform) Authorize(username string, extension string, password string, remember bool) (*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 ( ACCESS_TOKEN_TTL int = 3600 REFRESH_TOKEN_TTL int = 36000 // 10 hours REFRESH_TOKEN_TTL_REMEMBER int = 604800 // 1 week ACCOUNT_PREFIX string = "/account/" ACCOUNT_ID string = "~" TOKEN_ENDPOINT string = "/restapi/oauth/token" // #nosec G101 REVOKE_ENDPOINT string = "/restapi/oauth/revoke" API_VERSION string = "v1.0" URL_PREFIX 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.