Documentation
¶
Index ¶
- type ThemeLicenseService
- func (s *ThemeLicenseService) DeleteLicense(ctx context.Context, licenseKey string) error
- func (s *ThemeLicenseService) GetAllLicenses(ctx context.Context) ([]*models.ThemeLicense, error)
- func (s *ThemeLicenseService) GetLicenseByKey(ctx context.Context, licenseKey string) (*models.ThemeLicense, error)
- func (s *ThemeLicenseService) HasPremiumAccess(ctx context.Context) (bool, error)
- func (s *ThemeLicenseService) RefreshAllLicenses(ctx context.Context) error
- func (s *ThemeLicenseService) ValidateAndStoreLicense(ctx context.Context, licenseKey string) (*models.ThemeLicense, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThemeLicenseService ¶
type ThemeLicenseService struct {
// contains filtered or unexported fields
}
ThemeLicenseService handles theme license operations
func NewThemeLicenseService ¶
func NewThemeLicenseService(db *database.DB, polarClient *polar.Client) *ThemeLicenseService
NewThemeLicenseService creates a new theme license service
func (*ThemeLicenseService) DeleteLicense ¶
func (s *ThemeLicenseService) DeleteLicense(ctx context.Context, licenseKey string) error
DeleteLicense removes a license from the database
func (*ThemeLicenseService) GetAllLicenses ¶
func (s *ThemeLicenseService) GetAllLicenses(ctx context.Context) ([]*models.ThemeLicense, error)
GetAllLicenses retrieves all theme licenses
func (*ThemeLicenseService) GetLicenseByKey ¶
func (s *ThemeLicenseService) GetLicenseByKey(ctx context.Context, licenseKey string) (*models.ThemeLicense, error)
GetLicenseByKey retrieves a license by its key
func (*ThemeLicenseService) HasPremiumAccess ¶
func (s *ThemeLicenseService) HasPremiumAccess(ctx context.Context) (bool, error)
HasPremiumAccess checks if the user has premium access
func (*ThemeLicenseService) RefreshAllLicenses ¶
func (s *ThemeLicenseService) RefreshAllLicenses(ctx context.Context) error
RefreshAllLicenses validates all stored licenses against Polar API
func (*ThemeLicenseService) ValidateAndStoreLicense ¶
func (s *ThemeLicenseService) ValidateAndStoreLicense(ctx context.Context, licenseKey string) (*models.ThemeLicense, error)
ValidateAndStoreLicense validates a license key and stores it if valid
Click to show internal directories.
Click to hide internal directories.