Documentation ¶
Index ¶
Constants ¶
View Source
const ( // QuotaObjects type of quota used by objects QuotaObjects = QuotaType("OBJECTS") // QuotaBandwidth type of quota used by bandwith metrics QuotaBandwidth = QuotaType("BANDWIDTH") // QuotaDevices type of quota used by devices QuotaDevices = QuotaType("DEVICES") // QuotaBillingDays type of quota used for billing period QuotaBillingDays = QuotaType("BILLINGPERIOD") )
Variables ¶
View Source
var ( // StandardBilling default billing info for standard plans StandardBilling = BillingInfo{ Type: "Monthly", AmountDue: 0, Currency: "USD", VatRegion: "World", } // StandardPlans define standard plans StandardPlans = map[string]Plan{ "AlphaTester": { Name: "AlphaTester", Quotas: map[QuotaType]Quota{ QuotaObjects: { Name: QuotaObjects, Max: 2, Unit: "GiB", }, QuotaBandwidth: { Name: QuotaBandwidth, Max: 2, Unit: "GiB", }, QuotaDevices: { Name: QuotaDevices, Max: 25, Unit: "Piece", }, QuotaBillingDays: { Name: QuotaBillingDays, Max: 30, Unit: "Days", }, }, Billing: BillingInfo{ Type: "Monthly", AmountDue: 0, Currency: "USD", VatRegion: "World", }, }, "VIP": { Name: "VIP", Quotas: map[QuotaType]Quota{ QuotaObjects: { Name: QuotaObjects, Max: 25, Unit: "GiB", }, QuotaBandwidth: { Name: QuotaBandwidth, Max: 50, Unit: "GiB", }, QuotaDevices: { Name: QuotaDevices, Max: 100, Unit: "Piece", }, QuotaBillingDays: { Name: QuotaBillingDays, Max: 30, Unit: "Days", }, }, Billing: BillingInfo{ Type: "Monthly", AmountDue: 0, Currency: "USD", VatRegion: "World", }, }, } )
Functions ¶
This section is empty.
Types ¶
type App ¶
App define a new rest application for dash
func New ¶
func New(jwtMiddleware *jwt.JWTMiddleware, subService subscriptions.SubscriptionService, mongoClient *mongo.Client) *App
New create a dash rest application
type BillingInfo ¶
BillingInfo billing information, how amount to be charged, current and vat
type DeviceInfo ¶
type DeviceInfo struct { DeviceID string `json:"device-id"` Nick string `json:"nick"` Prn string `json:"prn"` Message string `json:"message"` Type string `json:"type"` Status string `json:"status"` LastActivity time.Time `json:"last-activity"` }
DeviceInfo define the payload for device information
type DiskQuotaUsageResult ¶
DiskQuotaUsageResult define disk usage metrics
type ModelError ¶
ModelError error payload (code, message)
type Plan ¶
type Plan struct { Name string Quotas map[QuotaType]Quota Billing BillingInfo }
Plan definition of a billing plan
type PlanQuotas ¶
type PlanQuotas map[QuotaType]QuotaValue
PlanQuotas map with thefinitions of all plans
type SubscriptionInfo ¶
type SubscriptionInfo struct { PlanID string `json:"plan-id"` Billing BillingInfo `json:"billing"` QuotaStats map[QuotaType]Quota `json:"quota-stats"` }
SubscriptionInfo subscription information
type Summary ¶
type Summary struct { Prn string `json:"prn"` Nick string `json:"nick"` Sub SubscriptionInfo `json:"subscription"` TopDevices []DeviceInfo `json:"top-devices"` }
Summary user dashboard summary including their top devices and subscription
Click to show internal directories.
Click to hide internal directories.