license

package
v0.7.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKeyPair

func GenerateKeyPair() (publicKey, privateKey string, err error)

GenerateKeyPair generates a new key pair for license signing

Types

type License

type License struct {
	PluginName string    `json:"plugin_name"`
	CustomerID string    `json:"customer_id"`
	IssuedAt   time.Time `json:"issued_at"`
	ExpiresAt  time.Time `json:"expires_at"`
	Features   []string  `json:"features"`
	MaxUsers   int       `json:"max_users,omitempty"`
	Signature  string    `json:"signature"`
}

License represents a plugin license

func GenerateLicense

func GenerateLicense(pluginName, customerID string, expiresAt time.Time, privateKeyBase64 string) (*License, error)

GenerateLicense generates a test license (for development only)

type LicenseValidator

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

LicenseValidator validates plugin licenses

func NewLicenseValidator

func NewLicenseValidator(publicKeyBase64, cacheDir string) (*LicenseValidator, error)

NewLicenseValidator creates a new license validator

func (*LicenseValidator) IsLicenseValid

func (lv *LicenseValidator) IsLicenseValid(pluginName string) (bool, error)

IsLicenseValid checks if a license is valid for a plugin

func (*LicenseValidator) ValidateCachedLicense

func (lv *LicenseValidator) ValidateCachedLicense(pluginName string) (*License, error)

ValidateCachedLicense validates a license from cache

func (*LicenseValidator) ValidateLicense

func (lv *LicenseValidator) ValidateLicense(licensePath string) (*License, error)

ValidateLicense validates a license file

Jump to

Keyboard shortcuts

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