license

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Claims added in v1.0.0

type Claims struct {
	jwt.RegisteredClaims

	Owner string `json:"owner"`
	Plan  string `json:"plan"`
	Trial bool   `json:"trial"`
}

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 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) (*apiv1pb.Subscription, error)

func (*LicenseService) IsFeatureEnabled

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

func (*LicenseService) LoadSubscription

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

func (*LicenseService) UpdateSubscription

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

type ValidateResult added in v1.0.0

type ValidateResult struct {
	Plan        apiv1pb.PlanType
	ExpiresTime time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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