Versions in this module Expand all Collapse all v0 v0.2.0 Feb 6, 2022 Changes in this version + var ErrCustomerNotFound = errors.New("customer not found") + var ErrKeyNotFound = errors.New("key not found") + var ErrLicenseNotFound = errors.New("license not found") + var ErrTariffNotFound = errors.New("tariff not found") + func CustomersList() *[]Customer + func DeactivateLicenseBySubID(uid uint32) error + func LicensesListBySubscriptionID(uid string) *[]License + func SubscriptionsByCustomerID(customerID string) *[]CustomerSubscriptionsList + func TariffsList() *[]Tariff + type Customer struct + CreatedAt time.Time + ID uint32 + Name string + Status bool + UpdatedAt time.Time + func (c *Customer) DeleteCustomer(uid uint32) (int64, error) + func (c *Customer) FindCustomerByID(uid uint32) (*Customer, error) + func (c *Customer) SaveCustomer() (*Customer, error) + func (c *Customer) UpdateCustomer(uid uint32) (*Customer, error) + type CustomerSubscriptionsList struct + CreatedAt time.Time + CustomerID string + CustomerName string + ID uint32 + Status bool + StripeID string + TariffID uint32 + TariffName string + UpdatedAt time.Time + type License struct + CreatedAt time.Time + Hash string + ID uint32 + License []byte + Status bool + SubscriptionID uint32 + UpdatedAt time.Time + func (l *License) DeleteLicense(uid uint32) (int64, error) + func (l *License) FindLicense(key []byte) (*License, error) + func (l *License) FindLicenseByID(uid uint32) (*License, error) + func (l *License) SaveLicense() (*License, error) + func (l *License) UpdateLicense(uid uint32) (*License, error) + type Subscription struct + CreatedAt time.Time + CustomerID uint32 + ID uint32 + Status bool + StripeID string + TariffID uint32 + UpdatedAt time.Time + func (s *Subscription) DeleteSubscription(uid uint32) (int64, error) + func (s *Subscription) FindSubscriptionByID(uid uint32) (*Subscription, error) + func (s *Subscription) FindSubscriptionByStripeID(stripeID string) (*Subscription, error) + func (s *Subscription) SaveSubscription() (*Subscription, error) + func (s *Subscription) UpdateSubscription(uid uint32) (*Subscription, error) + type Tariff struct + CreatedAt time.Time + ID uint32 + Name string + Price int + Robots bool + Tandem bool + Triaxis bool + UpdatedAt time.Time + Users int + func (t *Tariff) DeleteTariff(uid uint32) (int64, error) + func (t *Tariff) FindTariffByID(uid uint32) (*Tariff, error) + func (t *Tariff) SaveTariff() (*Tariff, error) + func (t *Tariff) UpdateTariff(uid uint32) (*Tariff, error)