Documentation ¶
Index ¶
- type Client
- func (c *Client) CheckHealth(ctx context.Context) error
- func (c *Client) Close() error
- func (c *Client) CreateCustomer(ctx context.Context, key thread.PubKey, email string, username string, ...) (string, error)
- func (c *Client) DeleteCustomer(ctx context.Context, key thread.PubKey) error
- func (c *Client) GetCustomer(ctx context.Context, key thread.PubKey) (*pb.GetCustomerResponse, error)
- func (c *Client) GetCustomerSession(ctx context.Context, key thread.PubKey) (*pb.GetCustomerSessionResponse, error)
- func (c *Client) GetCustomerUsage(ctx context.Context, key thread.PubKey) (*pb.GetCustomerUsageResponse, error)
- func (c *Client) Identify(ctx context.Context, key thread.PubKey, accountType mdb.AccountType, ...)
- func (c *Client) IncCustomerUsage(ctx context.Context, key thread.PubKey, productUsage map[string]int64) (*pb.IncCustomerUsageResponse, error)
- func (c *Client) ListDependentCustomers(ctx context.Context, key thread.PubKey, opts ...ListOption) (*pb.ListDependentCustomersResponse, error)
- func (c *Client) RecreateCustomerSubscription(ctx context.Context, key thread.PubKey) error
- func (c *Client) ReportCustomerUsage(ctx context.Context, key thread.PubKey) error
- func (c *Client) TrackEvent(ctx context.Context, key thread.PubKey, accountType mdb.AccountType, ...)
- func (c *Client) UpdateCustomer(ctx context.Context, customerID string, balance int64, ...) error
- func (c *Client) UpdateCustomerSubscription(ctx context.Context, customerID string, status stripe.SubscriptionStatus, ...) error
- type ListOption
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the client api.
func NewClient ¶
func NewClient(target string, opts ...grpc.DialOption) (*Client, error)
NewClient starts the client.
func (*Client) CreateCustomer ¶
func (*Client) DeleteCustomer ¶
func (*Client) GetCustomer ¶
func (*Client) GetCustomerSession ¶
func (*Client) GetCustomerUsage ¶ added in v2.1.5
func (*Client) Identify ¶ added in v2.6.0
func (c *Client) Identify( ctx context.Context, key thread.PubKey, accountType mdb.AccountType, active bool, email string, properties map[string]string, )
Identify creates or updates the user traits
func (*Client) IncCustomerUsage ¶
func (*Client) ListDependentCustomers ¶
func (c *Client) ListDependentCustomers(ctx context.Context, key thread.PubKey, opts ...ListOption) ( *pb.ListDependentCustomersResponse, error)
func (*Client) RecreateCustomerSubscription ¶
func (*Client) ReportCustomerUsage ¶ added in v2.1.5
func (*Client) TrackEvent ¶ added in v2.6.0
func (c *Client) TrackEvent( ctx context.Context, key thread.PubKey, accountType mdb.AccountType, active bool, event analytics.Event, properties map[string]string, )
TrackEvent records a new event
func (*Client) UpdateCustomer ¶
func (*Client) UpdateCustomerSubscription ¶
type ListOption ¶
type ListOption func(*listOptions)
func WithLimit ¶
func WithLimit(limit int64) ListOption
WithLimit is used to set a page size when paginating.
func WithOffset ¶
func WithOffset(offset int64) ListOption
WithOffset is used to fetch the next page when paginating.
type Option ¶
type Option func(*options)
func WithParent ¶ added in v2.1.7
WithParent is used to create a billing hierarchy between two customers.
Click to show internal directories.
Click to hide internal directories.