database

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2025 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func New

func New(databasePath string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) Conn

func (db *DB) Conn() *sql.DB

type LicenseRepo added in v1.0.0

type LicenseRepo struct {
	// contains filtered or unexported fields
}

func NewLicenseRepo added in v1.0.0

func NewLicenseRepo(db *DB) *LicenseRepo

func (*LicenseRepo) DeleteLicense added in v1.0.0

func (r *LicenseRepo) DeleteLicense(ctx context.Context, licenseKey string) error

DeleteLicense removes a license from the database

func (*LicenseRepo) GetAllLicenses added in v1.0.0

func (r *LicenseRepo) GetAllLicenses(ctx context.Context) ([]*models.ProductLicense, error)

GetAllLicenses retrieves all licenses

func (*LicenseRepo) GetLicenseByKey added in v1.0.0

func (r *LicenseRepo) GetLicenseByKey(ctx context.Context, licenseKey string) (*models.ProductLicense, error)

GetLicenseByKey retrieves a license by its key

func (*LicenseRepo) HasPremiumAccess added in v1.0.0

func (r *LicenseRepo) HasPremiumAccess(ctx context.Context) (bool, error)

HasPremiumAccess checks if the user has purchased premium access (one-time unlock)

func (*LicenseRepo) StoreLicense added in v1.0.0

func (r *LicenseRepo) StoreLicense(ctx context.Context, license *models.ProductLicense) error

func (*LicenseRepo) UpdateLicenseActivation added in v1.0.0

func (r *LicenseRepo) UpdateLicenseActivation(ctx context.Context, license *models.ProductLicense) error

UpdateLicenseActivation updates a license with activation details

func (*LicenseRepo) UpdateLicenseStatus added in v1.0.0

func (r *LicenseRepo) UpdateLicenseStatus(ctx context.Context, licenseID int, status string) error

func (*LicenseRepo) UpdateLicenseValidation added in v1.0.0

func (r *LicenseRepo) UpdateLicenseValidation(ctx context.Context, license *models.ProductLicense) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL