license

package
v0.0.0-...-a2e00f7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package license helps manage commercial licenses and check if they are valid for the version of unidoc used.

Index

Constants

View Source
const (
	LicenseTierUnlicensed = "unlicensed"
	LicenseTierCommunity  = "community"
	LicenseTierIndividual = "individual"
	LicenseTierBusiness   = "business"
)

Variables

This section is empty.

Functions

func SetLicenseKey

func SetLicenseKey(content string, customerName string) error

SetLicenseKey sets and validates the license key.

Types

type LicenseKey

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"`
	CreatedBy    string     `json:"created_by"`
	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 MakeUnlicensedKey

func MakeUnlicensedKey() *LicenseKey

func (*LicenseKey) ToString

func (k *LicenseKey) ToString() string

func (*LicenseKey) TypeToString

func (k *LicenseKey) TypeToString() string

func (*LicenseKey) Validate

func (k *LicenseKey) Validate() error

Jump to

Keyboard shortcuts

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