pro

package
v0.0.0-...-66cde0a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	UpdateUserData(ctx context.Context, session ClientSession) (*protos.User, error)
}

type ClientSession

type ClientSession interface {
	SetExpiration(int64) error
	SetProUser(bool) error
	SetReferralCode(string) error
	SetUserIDAndToken(int64, string) error
	GetDeviceID() (string, error)
	GetUserFirstVisit() (bool, error)
	SetEmailAddress(string) error
}

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"`
}

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
	Client
	EmailExists(ctx context.Context, email string) (*protos.BaseResponse, error)
	DesktopPaymentMethods(ctx context.Context) ([]*protos.PaymentMethod, error)
	PaymentMethods(ctx context.Context) (*PaymentMethodsResponse, error)
	PaymentMethodsV4(ctx context.Context) (*PaymentMethodsResponse, error)
	PaymentRedirect(ctx context.Context, req *protos.PaymentRedirectRequest) (*PaymentRedirectResponse, error)
	FetchPaymentMethodsAndCache(ctx context.Context) (*PaymentMethodsResponse, error)
	Plans(ctx context.Context) ([]*protos.Plan, error)
	PollUserData(ctx context.Context, session ClientSession, maxElapsedTime time.Duration, client Client)
	RedeemResellerCode(ctx context.Context, req *protos.RedeemResellerCodeRequest) (*protos.BaseResponse, error)
	RetryCreateUser(ctx context.Context, ss ClientSession, maxElapsedTime time.Duration)
	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, 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)
}

func NewClient

func NewClient(baseURL string, userConfig func() common.UserConfig) ProClient

NewClient creates a new instance of ProClient

type PurchaseResponse

type PurchaseResponse struct {
	*protos.BaseResponse `json:",inline"`
	PaymentStatus        string      `json:"paymentStatus"`
	Plan                 protos.Plan `json:"plan"`
	Status               string      `json:"status"`
}

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

type UserRecovery struct {
	Status string `json:"status"`
	UserID int64  `json:"userID"`
	Token  string `json:"token"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL