Versions in this module Expand all Collapse all v7 v7.0.2 Aug 20, 2024 v7.0.1 Jul 8, 2024 v7.0.0 Apr 19, 2024 Changes in this version + var ErrOTPRequired = errors.New("OTP Required") + func IsOTPRequired(err error) bool + func IsRequestFailedError(err error) bool + func NewRequestFailedError(res *http.Response, req *APIRequest) error + type APIConfig struct + Prefix string + type APIError struct + Error string + type APIRequest struct + Endpoint string + Expected Statuses + HTTPRequest *http.Request + Method string + NoAuth bool + OTP string + Params interface{} + Password string + Token string + URL string + Username string + func (req *APIRequest) BuildQueryFromParams() (url.Values, error) + type APITokenGenerator struct + APIToken string + TokensService TokensService + func NewAPITokenGenerator(tokensService TokensService, apiToken string) *APITokenGenerator + func (t *APITokenGenerator) GetAccessToken(ctx context.Context) (string, error) + type AdddonTokenExchanger interface + AddonToken func(ctx context.Context, app, addonID string) (string, error) + type AddonTokenGenerator struct + func (c *AddonTokenGenerator) GetAccessToken(ctx context.Context) (string, error) + type BadRequestError struct + Code string + ErrMessage string + func (err BadRequestError) Error() string + type Client interface + BaseURL func() string + Do func(context.Context, *APIRequest) (*http.Response, error) + DoRequest func(ctx context.Context, req *APIRequest, data interface{}) error + HTTPClient func() *http.Client + IsAuthenticatedClient func() bool + ResourceAdd func(ctx context.Context, resource string, payload, data interface{}) error + ResourceDelete func(ctx context.Context, resource, resourceID string) error + ResourceGet func(ctx context.Context, resource, resourceID string, payload, data interface{}) error + ResourceList func(ctx context.Context, resource string, payload, data interface{}) error + ResourceUpdate func(ctx context.Context, resource, resourceID string, payload, data interface{}) error + SubresourceAdd func(ctx context.Context, resource, resourceID, subresource string, ...) error + SubresourceDelete func(ctx context.Context, resource, resourceID, subresource, id string) error + SubresourceGet func(ctx context.Context, resource, resourceID, subresource, id string, ...) error + SubresourceList func(ctx context.Context, resource, resourceID, subresource string, ...) error + SubresourceUpdate func(ctx context.Context, resource, resourceID, subresource, id string, ...) error + TokenGenerator func() TokenGenerator + func NewClient(cfg ClientConfig) Client + type ClientConfig struct + APIConfig APIConfig + Endpoint string + TLSConfig *tls.Config + Timeout time.Duration + TokenGenerator TokenGenerator + UserAgent string + type ForbiddenError struct + Code string + Err string + func (err ForbiddenError) Error() string + type NotFoundError struct + Err string + Resource string + func (err NotFoundError) Error() string + type PaymentRequiredError struct + ErrMessage string + Name string + URL string + func (err PaymentRequiredError) Error() string + type RequestFailedError struct + APIError error + Code int + Message string + Req *APIRequest + func (err *RequestFailedError) Error() string + func (err *RequestFailedError) String() string + type Statuses []int + func (statuses Statuses) Contains(status int) bool + type TokenGenerator interface + GetAccessToken func(context.Context) (string, error) + func NewAddonTokenGenerator(app, addon string, exchanger AdddonTokenExchanger) TokenGenerator + type TokensService interface + TokenExchange func(ctx context.Context, token string) (string, error) + type TooManyRequestsError struct + Code string + ErrMessage string + func (err TooManyRequestsError) Error() string + type UnprocessableEntity struct + Errors map[string][]string + func (err UnprocessableEntity) Error() string Other modules containing this package github.com/Scalingo/go-scalingo github.com/Scalingo/go-scalingo/v4 github.com/Scalingo/go-scalingo/v5 github.com/Scalingo/go-scalingo/v6