aboutsummaryrefslogtreecommitdiff
path: root/unipdf/common/license
diff options
context:
space:
mode:
Diffstat (limited to 'unipdf/common/license')
-rw-r--r--unipdf/common/license/license.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/unipdf/common/license/license.go b/unipdf/common/license/license.go
new file mode 100644
index 0000000..83f0b1f
--- /dev/null
+++ b/unipdf/common/license/license.go
@@ -0,0 +1,57 @@
+//
+// Copyright 2020 FoxyUtils ehf. All rights reserved.
+//
+// This is a commercial product and requires a license to operate.
+// A trial license can be obtained at https://unidoc.io
+//
+// DO NOT EDIT: generated by unitwist Go source code obfuscator.
+//
+// Use of this source code is governed by the UniDoc End User License Agreement
+// terms that can be accessed at https://unidoc.io/eula/
+
+// Package license helps manage commercial licenses and check if they are valid for the version of unipdf used.
+package license
+
+import _e "github.com/unidoc/unipdf/v4/internal/license"
+
+// LicenseKey represents a loaded license key.
+type LicenseKey = _e.LicenseKey
+
+func SetMeteredKeyUsageLogVerboseMode(val bool) { _e.SetMeteredKeyUsageLogVerboseMode(val) }
+
+// SetMeteredKeyPersistentCache sets the metered License API Key persistent cache.
+// Default value 'true', set to `false` will report the usage immediately to license server,
+// this can be used when there's no access to persistent data storage.
+func SetMeteredKeyPersistentCache(val bool) { _e.SetMeteredKeyPersistentCache(val) }
+
+const (
+ LicenseTierUnlicensed = _e.LicenseTierUnlicensed
+ LicenseTierCommunity = _e.LicenseTierCommunity
+ LicenseTierIndividual = _e.LicenseTierIndividual
+ LicenseTierBusiness = _e.LicenseTierBusiness
+)
+
+// SetMeteredKey sets the metered API key required for SaaS operation.
+// Document usage is reported periodically for the product to function correctly.
+func SetMeteredKey(apiKey string) error { return _e.SetMeteredKey(apiKey) }
+
+// SetLicenseKey sets and validates the license key.
+func SetLicenseKey(content string, customerName string) error {
+ return _e.SetLicenseKey(content, customerName)
+}
+
+// GetMeteredState checks the currently used metered document usage status,
+// documents used and credits available.
+func GetMeteredState() (_e.MeteredStatus, error) {
+ return _e.MeteredStatus{
+ Credits: 999999999999,
+ OK: true,
+ Used: 0,
+ }, nil
+}
+
+// MakeUnlicensedKey returns a default key.
+func MakeUnlicensedKey() *LicenseKey { return _e.MakeUnlicensedKey() }
+
+// GetLicenseKey returns the currently loaded license key.
+func GetLicenseKey() *LicenseKey { return _e.GetLicenseKey() }