License tiers.
const ( LicenseTierUnlicensed = "unlicensed" LicenseTierCommunity = "community" LicenseTierIndividual = "individual" LicenseTierBusiness = "business" )
func SetLegacyLicenseKey(s string) error
SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019. Will be removed at some point in a future major version.
func SetLicenseKey(content string, customerName string) error
SetLicenseKey sets and validates the license key.
LegacyLicense holds the old-style unioffice license information.
type LegacyLicense struct { Name string Signature string `json:",omitempty"` Expiration time.Time LicenseType LegacyLicenseType }
func (l LegacyLicense) Verify(pubKey *rsa.PublicKey) error
Verify verifies a license by checking the license content and signature against a public key.
LegacyLicenseType is the type of license
type LegacyLicenseType byte
LicenseKey represents a license key for UniOffice.
type LicenseKey struct { LicenseId string `json:"license_id"` CustomerId string `json:"customer_id"` CustomerName string `json:"customer_name"` Tier string `json:"tier"` CreatedAt time.Time `json:"-"` CreatedAtInt int64 `json:"created_at"` ExpiresAt time.Time `json:"-"` ExpiresAtInt int64 `json:"expires_at"` CreatorName string `json:"creator_name"` CreatorEmail string `json:"creator_email"` UniPDF bool `json:"unipdf"` UniOffice bool `json:"unioffice"` Trial bool `json:"trial"` // For trial licenses. }
func GetLicenseKey() *LicenseKey
func MakeUnlicensedKey() *LicenseKey
MakeUnlicensedKey returns an unlicensed key.
func (k *LicenseKey) IsLicensed() bool
IsLicensed returns true if the package is licensed.
func (k *LicenseKey) ToString() string
ToString returns a string representing the license information.
func (k *LicenseKey) TypeToString() string
TypeToString returns a string representation of the license type.
func (k *LicenseKey) Validate() error
Validate returns an error if the licenseis invalid, nil otherwise.