Documentation
¶
Index ¶
- Constants
- type APIError
- type Client
- func (c *Client) Context() (context.Context, context.CancelFunc)
- func (c *Client) Delete(ctx context.Context, path string) error
- func (c *Client) Do(ctx context.Context, method, path string, body interface{}, result interface{}) error
- func (c *Client) Get(ctx context.Context, path string, result interface{}) error
- func (c *Client) GetProjectID() string
- func (c *Client) ListAll(ctx context.Context, path string, limit int, ...) error
- func (c *Client) Patch(ctx context.Context, path string, body, result interface{}) error
- func (c *Client) Post(ctx context.Context, path string, body, result interface{}) error
- type ListResponse
Constants ¶
View Source
const BaseURL = "https://api.revenuecat.com/v2"
BaseURL is the RevenueCat API v2 base URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
StatusCode int `json:"-"`
Type string `json:"type"`
Message string `json:"message"`
Param string `json:"param,omitempty"`
DocURL string `json:"doc_url,omitempty"`
}
APIError represents a structured error from the RevenueCat API
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the RevenueCat API client
func (*Client) Context ¶
func (c *Client) Context() (context.Context, context.CancelFunc)
Context returns a context with timeout
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, method, path string, body interface{}, result interface{}) error
Do executes an API request
func (*Client) GetProjectID ¶
GetProjectID returns the project ID
func (*Client) ListAll ¶
func (c *Client) ListAll(ctx context.Context, path string, limit int, collector func(json.RawMessage) error) error
ListAll fetches all pages and collects items
type ListResponse ¶
type ListResponse struct {
Items json.RawMessage `json:"items"`
NextPage string `json:"next_page,omitempty"`
URL string `json:"url,omitempty"`
TotalCount int `json:"total_count,omitempty"`
}
ListResponse represents a paginated list response
Click to show internal directories.
Click to hide internal directories.