Documentation ¶
Index ¶
- Variables
- func CustomersList() *[]Customer
- func DeactivateLicenseBySubID(uid uint32) error
- func LicensesListBySubscriptionID(uid string) *[]License
- func SubscriptionsByCustomerID(customerID string) *[]CustomerSubscriptionsList
- func TariffsList() *[]Tariff
- type Customer
- type CustomerSubscriptionsList
- type License
- type Subscription
- 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
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrKeyNotFound is a ... ErrKeyNotFound = errors.New("key not found") // ErrLicenseNotFound is a ... ErrLicenseNotFound = errors.New("license not found") // ErrTariffNotFound is a ... ErrTariffNotFound = errors.New("tariff not found") // ErrCustomerNotFound is a ... ErrCustomerNotFound = errors.New("customer not found") )
Functions ¶
func DeactivateLicenseBySubID ¶
DeactivateLicenseBySubID is a ...
func LicensesListBySubscriptionID ¶
LicensesListBySubscriptionID is a ...
func SubscriptionsByCustomerID ¶
func SubscriptionsByCustomerID(customerID string) *[]CustomerSubscriptionsList
SubscriptionsByCustomerID is a ...
Types ¶
type Customer ¶
type Customer struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:255;not null;unique" json:"name"` Status bool `gorm:"false" json:"status"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
Customer is a ...
func (*Customer) DeleteCustomer ¶
DeleteCustomer is a ...
func (*Customer) FindCustomerByID ¶
FindCustomerByID is a ...
func (*Customer) SaveCustomer ¶
SaveCustomer is a ...
type CustomerSubscriptionsList ¶
type CustomerSubscriptionsList struct { ID uint32 `json:"id"` StripeID string `json:"stripe_id"` CustomerID string `json:"customer_id"` CustomerName string `json:"customer_name"` TariffID uint32 `json:"tariff_id"` TariffName string `json:"tariff_name"` Status bool `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
CustomerSubscriptionsList is a ...
type License ¶
type License struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` SubscriptionID uint32 `sql:"type:int REFERENCES subscriptions(id)" json:"subscription_id"` License []byte `gorm:"null" json:"license"` Hash string `gorm:"null" json:"hash"` Status bool `gorm:"false" json:"status"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
License is a ...
func (*License) DeleteLicense ¶
DeleteLicense is a ...
func (*License) FindLicense ¶
FindLicense is a ...
func (*License) FindLicenseByID ¶
FindLicenseByID is a ...
func (*License) SaveLicense ¶
SaveLicense is a ...
type Subscription ¶
type Subscription struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` StripeID string `gorm:"size:18;not null;unique" json:"stripe_id"` CustomerID uint32 `sql:"type:int REFERENCES customers(id)" json:"customer_id"` TariffID uint32 `sql:"type:int REFERENCES tariffs(id)" json:"tariff_id"` Status bool `gorm:"false" json:"status"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
Subscription is a ...
func (*Subscription) DeleteSubscription ¶
func (s *Subscription) DeleteSubscription(uid uint32) (int64, error)
DeleteSubscription is a ...
func (*Subscription) FindSubscriptionByID ¶
func (s *Subscription) FindSubscriptionByID(uid uint32) (*Subscription, error)
FindSubscriptionByID is a ...
func (*Subscription) FindSubscriptionByStripeID ¶
func (s *Subscription) FindSubscriptionByStripeID(stripeID string) (*Subscription, error)
FindSubscriptionByStripeID is a ...
func (*Subscription) SaveSubscription ¶
func (s *Subscription) SaveSubscription() (*Subscription, error)
SaveSubscription is a ...
func (*Subscription) UpdateSubscription ¶
func (s *Subscription) UpdateSubscription(uid uint32) (*Subscription, error)
UpdateSubscription is a ...
type Tariff ¶
type Tariff struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Name string `gorm:"size:255;not null;unique" json:"name"` Price int `gorm:"size:6;not null" json:"price"` Tandem bool `gorm:"size:1;not null" json:"crossbar"` Triaxis bool `gorm:"size:1;not null" json:"triaxis"` Robots bool `gorm:"size:1;not null" json:"robots"` Users int `gorm:"size:6;not null" json:"users"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
Tariff is a ...
func (*Tariff) DeleteTariff ¶
DeleteTariff is a ...
func (*Tariff) FindTariffByID ¶
FindTariffByID is a ...
Click to show internal directories.
Click to hide internal directories.