From e17a425dfb3382310fb5863f516dacdca9f44956 Mon Sep 17 00:00:00 2001 From: leshe4ka46 Date: Sun, 19 Oct 2025 14:47:59 +0300 Subject: fuck the unipdf licencing --- unipdf/common/license/license.go | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 unipdf/common/license/license.go (limited to 'unipdf/common/license/license.go') 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() } -- cgit v1.2.3