Documentation ¶
Index ¶
- func APIHandler(proAPIHost string, userConfig common.UserConfig) http.Handler
- func NewHTTPClient(rt http.RoundTripper, timeout time.Duration) *http.Client
- type LinkCodeRedeemResponse
- type LinkCodeResponse
- type LinkResponse
- type OkResponse
- type PaymentMethodsResponse
- type PaymentRedirectResponse
- type PlansResponse
- type ProClient
- type PurchaseResponse
- type RestorePurchaseRequest
- type UserDataResponse
- type UserRecovery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIHandler ¶
func APIHandler(proAPIHost string, userConfig common.UserConfig) http.Handler
APIHandler returns an HTTP handler that specifically looks for and properly handles pro server requests.
func NewHTTPClient ¶
NewHTTPClient creates a new http.Client that is configured to use the given options and http.RoundTripper wrapped with proxied.AsRoundTripper to process requests
Types ¶
type LinkCodeRedeemResponse ¶
type LinkCodeRedeemResponse struct { *protos.BaseResponse `json:",inline"` Status string `json:"status"` UserID int64 `json:"userId"` Token string `json:"token"` }
type LinkCodeResponse ¶
type LinkCodeResponse struct { *protos.BaseResponse `json:",inline"` Code string ExpireAt int64 }
type LinkResponse ¶
type LinkResponse struct { *protos.BaseResponse `json:",inline"` UserID int `json:"userID"` ProToken string `json:"token"` }
type OkResponse ¶
type OkResponse struct {
Status string `json:"status"`
}
type PaymentMethodsResponse ¶
type PaymentMethodsResponse struct { *protos.BaseResponse `json:",inline"` Providers map[string][]protos.PaymentMethod `json:"providers"` Plans []protos.Plan `json:"plans"` Logo map[string]interface{} `json:"icons"` }
type PaymentRedirectResponse ¶
type PaymentRedirectResponse struct { *protos.BaseResponse `json:",inline"` Redirect string `json:"redirect"` }
type PlansResponse ¶
type PlansResponse struct { *protos.BaseResponse `json:",inline"` Plans []protos.Plan `json:"plans"` }
type ProClient ¶
type ProClient interface { webclient.RESTClient EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error) PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error) PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error) PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error) Plans(ctx context.Context) (*PlansResponse, error) RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error) UserCreate(ctx context.Context) (*UserDataResponse, error) UserData(ctx context.Context) (*UserDataResponse, error) PurchaseRequest(ctx context.Context, data map[string]interface{}) (*PurchaseResponse, error) RestorePurchase(ctx context.Context, req map[string]interface{}) (*OkResponse, error) EmailRequest(ctx context.Context, email string) (*OkResponse, error) ReferralAttach(ctx context.Context, refCode string) (bool, error) //Device Linking LinkCodeApprove(ctx context.Context, code string) (*protos.BaseResponse, error) LinkCodeRequest(ctx context.Context, deviceName string) (*LinkCodeResponse, error) LinkCodeRedeem(ctx context.Context, deviceName string, deviceCode string) (*LinkCodeRedeemResponse, error) UserLinkCodeRequest(ctx context.Context, deviceId string, email string) (bool, error) UserLinkValidate(ctx context.Context, code string) (*UserRecovery, error) DeviceRemove(ctx context.Context, deviceId string) (*LinkResponse, error) DeviceAdd(ctx context.Context, deviceName string) (bool, error) }
type PurchaseResponse ¶
type RestorePurchaseRequest ¶
type RestorePurchaseRequest struct { Provider string Token string DeviceName string Email string Code string }
Request
type UserDataResponse ¶
type UserDataResponse struct { *protos.BaseResponse `json:",inline"` *protos.User `json:",inline"` }
type UserRecovery ¶
Click to show internal directories.
Click to hide internal directories.