license

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

FeatureMatrix is a matrix of features in [Free, Pro].

Functions

func SetLicenseCache

func SetLicenseCache(licenseKey, instanceName string, license LicenseKey)

Types

type ActiveLicenseKeyResponse

type ActiveLicenseKeyResponse struct {
	Activated  bool            `json:"activated"`
	Error      *string         `json:"error"`
	LicenseKey *LicenseKey     `json:"license_key"`
	Meta       *LicenseKeyMeta `json:"meta"`
}

type FeatureType

type FeatureType string
const (

	// FeatureTypeUnlimitedAccounts allows the user to create unlimited accounts.
	FeatureTypeUnlimitedAccounts FeatureType = "unlimited_accounts"
	// FeatureTypeUnlimitedAccounts allows the user to create unlimited collections.
	FeatureTypeUnlimitedCollections FeatureType = "unlimited_collections"

	// FeatureTypeCustomStyle allows the user to customize the style.
	FeatureTypeCustomeStyle FeatureType = "custom_style"
)

type LicenseKey

type LicenseKey struct {
	ID        int32   `json:"id"`
	Status    string  `json:"status"`
	Key       string  `json:"key"`
	CreatedAt string  `json:"created_at"`
	ExpiresAt *string `json:"updated_at"`
}

func GetLicenseCache

func GetLicenseCache(licenseKey, instanceName string) *LicenseKey

type LicenseKeyMeta

type LicenseKeyMeta struct {
	StoreID       int32  `json:"store_id"`
	OrderID       int32  `json:"order_id"`
	OrderItemID   int32  `json:"order_item_id"`
	ProductID     int32  `json:"product_id"`
	ProductName   string `json:"product_name"`
	VariantID     int32  `json:"variant_id"`
	VariantName   string `json:"variant_name"`
	CustomerID    int32  `json:"customer_id"`
	CustomerName  string `json:"customer_name"`
	CustomerEmail string `json:"customer_email"`
}

type LicenseService

type LicenseService struct {
	Profile *profile.Profile
	Store   *store.Store
	// contains filtered or unexported fields
}

func NewLicenseService

func NewLicenseService(profile *profile.Profile, store *store.Store) *LicenseService

NewLicenseService creates a new LicenseService.

func (*LicenseService) GetSubscription

func (s *LicenseService) GetSubscription(ctx context.Context) (*apiv2pb.Subscription, error)

func (*LicenseService) IsFeatureEnabled

func (s *LicenseService) IsFeatureEnabled(feature FeatureType) bool

func (*LicenseService) LoadSubscription

func (s *LicenseService) LoadSubscription(ctx context.Context) (*apiv2pb.Subscription, error)

func (*LicenseService) UpdateSubscription

func (s *LicenseService) UpdateSubscription(ctx context.Context, licenseKey string) (*apiv2pb.Subscription, error)

type ValidateLicenseKeyResponse

type ValidateLicenseKeyResponse struct {
	Valid      bool            `json:"valid"`
	Error      *string         `json:"error"`
	LicenseKey *LicenseKey     `json:"license_key"`
	Meta       *LicenseKeyMeta `json:"meta"`
}

Jump to

Keyboard shortcuts

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