Documentation
¶
Index ¶
- Constants
- Variables
- func AddCurrency(ctx context.Context, org *organization.Organization, cur currency.Type) error
- func AddMember(c context.Context, name, tag, storeId, geo string, p Period, value string, ...) error
- func AddSetMember(c context.Context, name, tag, storeId, geo string, p Period, value string, ...) error
- func Count(c context.Context, name string) (int, error)
- func IncrAffiliateFees(ctx context.Context, org *organization.Organization, affId string, ...) error
- func IncrOrder(ctx context.Context, ord *order.Order) error
- func IncrOrderRefund(ctx context.Context, ord *order.Order, refund int, t time.Time) error
- func IncrOrderReturn(ctx context.Context, items []lineitem.LineItem, rtn *return_.Return) error
- func IncrOrderShip(ctx context.Context, ord *order.Order, t time.Time) error
- func IncrProduct(ctx context.Context, prod *product.Product, ord *order.Order) error
- func IncrProductRefund(ctx context.Context, prod *product.Product, ord *order.Order) error
- func IncrProductReturn(ctx context.Context, prod *product.Product, ord *order.Order, ...) error
- func IncrProductShip(ctx context.Context, prod *product.Product, ord *order.Order) error
- func IncrReferrerFees(ctx context.Context, org *organization.Organization, refId string, ...) error
- func IncrStoreOrders(ctx context.Context, org *organization.Organization, storeId string, ...) error
- func IncrStoreProductOrders(ctx context.Context, org *organization.Organization, storeId string, ...) error
- func IncrStoreSales(ctx context.Context, org *organization.Organization, storeId string, ...) error
- func IncrSubscriber(ctx context.Context, t time.Time) error
- func IncrSubscribers(ctx context.Context, org *organization.Organization, mailinglistId string, ...) error
- func IncrTotalOrders(ctx context.Context, org *organization.Organization, t time.Time) error
- func IncrTotalProductOrders(ctx context.Context, org *organization.Organization, ord *order.Order, ...) error
- func IncrTotalSales(ctx context.Context, org *organization.Organization, pays []*payment.Payment, ...) error
- func IncrUser(ctx context.Context, t time.Time) error
- func IncrUsers(ctx context.Context, org *organization.Organization, t time.Time) error
- func IncreaseShards(c context.Context, name string, n int) error
- func Increment(c context.Context, name, tag, storeId, geo string, p Period, t time.Time) error
- func IncrementBy(c context.Context, name, tag, storeId, geo string, p Period, amount int, ...) error
- func IncrementByAll(ctx context.Context, tag, storeId, geo string, value int, t time.Time) error
- func MemberExists(c context.Context, name string, value string) bool
- func Members(c context.Context, name string) ([]string, error)
- type DashboardData
- type Period
- type Shard
- type TimeFunc
Constants ¶
View Source
const ( DefaultShards = 3 ConfigKind = "_counterconfig" ShardKind = "_countershard" )
Variables ¶
View Source
var AddMemberTask *delay.Function
View Source
var IncrementByTask *delay.Function
Functions ¶
func AddCurrency ¶
func AddCurrency(ctx context.Context, org *organization.Organization, cur currency.Type) error
func AddMember ¶
func AddMember(c context.Context, name, tag, storeId, geo string, p Period, value string, t time.Time) error
Adds a member to the array on the Shard
func AddSetMember ¶
func AddSetMember(c context.Context, name, tag, storeId, geo string, p Period, value string, t time.Time) error
Adds a member to the array if it does not exist
func IncrAffiliateFees ¶
func IncrAffiliateFees(ctx context.Context, org *organization.Organization, affId string, rfl *referral.Referral) error
func IncrOrderRefund ¶
func IncrOrderReturn ¶
func IncrProduct ¶
func IncrProductRefund ¶
func IncrProductReturn ¶
func IncrProductShip ¶
func IncrReferrerFees ¶
func IncrReferrerFees(ctx context.Context, org *organization.Organization, refId string, rfl *referral.Referral) error
func IncrStoreOrders ¶
func IncrStoreOrders(ctx context.Context, org *organization.Organization, storeId string, t time.Time) error
func IncrStoreProductOrders ¶
func IncrStoreProductOrders(ctx context.Context, org *organization.Organization, storeId string, ord *order.Order, t time.Time) error
func IncrStoreSales ¶
func IncrStoreSales(ctx context.Context, org *organization.Organization, storeId string, pays []*payment.Payment, t time.Time) error
func IncrSubscribers ¶
func IncrSubscribers(ctx context.Context, org *organization.Organization, mailinglistId string, t time.Time) error
func IncrTotalOrders ¶
func IncrTotalOrders(ctx context.Context, org *organization.Organization, t time.Time) error
func IncrTotalProductOrders ¶
func IncrTotalProductOrders(ctx context.Context, org *organization.Organization, ord *order.Order, t time.Time) error
func IncrTotalSales ¶
func IncrTotalSales(ctx context.Context, org *organization.Organization, pays []*payment.Payment, t time.Time) error
func IncrUsers ¶
func IncrUsers(ctx context.Context, org *organization.Organization, t time.Time) error
func IncreaseShards ¶
IncreaseShards increases the number of Shards for the named counter to n. It will never decrease the number of Shards.
func IncrementBy ¶
func IncrementBy(c context.Context, name, tag, storeId, geo string, p Period, amount int, t time.Time) error
Increment increments the named counter by amount
func IncrementByAll ¶
Types ¶
type DashboardData ¶
type DashboardData struct {
TotalSales currencyValue
TotalOrders int
TotalUsers int
TotalSubscribers int
DailySales currencyValues
DailyOrders []int
DailyUsers []int
DailySubscribers []int
}
func GetDashboardData ¶
func GetDashboardData(ctx context.Context, t Period, date time.Time, tzOffset int, org *organization.Organization) (DashboardData, error)
type Shard ¶
type Shard struct {
Name string `json:"name"`
Tag string `json:"tag"`
// Counter
Count int `json:"count"`
StoreId string `json:"storeId"`
Geo string `json:"geo"`
// Array
Set map[string]bool `datastore:"-"`
Set_ string `datastore:",noindex" json:"set"`
Period Period `json:"period"`
Time time.Time `json:"time"`
}
Click to show internal directories.
Click to hide internal directories.