unioffice/common/license/license.go

49 lines
2.4 KiB
Go
Raw Normal View History

2020-08-23 14:15:53 +00:00
//
// 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/
2021-03-16 20:51:18 +00:00
// Package license helps manage commercial licenses and check if they
// are valid for the version of UniOffice used.
2023-03-01 18:42:44 +00:00
package license ;import _a "github.com/unidoc/unioffice/internal/license";
2022-09-02 11:46:53 +00:00
2023-04-15 17:27:31 +00:00
// MakeUnlicensedKey returns a default key.
func MakeUnlicensedKey ()*LicenseKey {return _a .MakeUnlicensedKey ()};const (LicenseTierUnlicensed =_a .LicenseTierUnlicensed ;LicenseTierCommunity =_a .LicenseTierCommunity ;LicenseTierIndividual =_a .LicenseTierIndividual ;LicenseTierBusiness =_a .LicenseTierBusiness ;);
2022-06-27 19:44:23 +00:00
// LicenseKey represents a loaded license key.
2023-03-01 18:42:44 +00:00
type LicenseKey =_a .LicenseKey ;
2022-06-27 19:44:23 +00:00
// SetMeteredKey sets the metered License API key required for SaaS operation.
// Document usage is reported periodically for the product to function correctly.
2023-03-01 18:42:44 +00:00
func SetMeteredKey (apiKey string )error {return _a .SetMeteredKey (apiKey )};
2022-02-25 19:20:45 +00:00
2023-04-15 17:27:31 +00:00
// 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 SetLegacyLicenseKey (s string )error {return _a .SetLegacyLicenseKey (s )};
2023-03-01 18:42:44 +00:00
// LegacyLicenseType is the type of license
type LegacyLicenseType =_a .LegacyLicenseType ;
2022-09-02 11:46:53 +00:00
2023-04-15 17:27:31 +00:00
// LegacyLicense holds the old-style unioffice license information.
type LegacyLicense =_a .LegacyLicense ;
// 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 ){_a .SetMeteredKeyPersistentCache (val )};
2022-09-02 11:46:53 +00:00
2022-12-06 11:56:49 +00:00
// GetLicenseKey returns the currently loaded license key.
2023-03-01 18:42:44 +00:00
func GetLicenseKey ()*LicenseKey {return _a .GetLicenseKey ()};
2023-04-15 17:27:31 +00:00
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {return _a .SetLicenseKey (content ,customerName );};
// GetMeteredState checks the currently used metered document usage status,
// documents used and credits available.
func GetMeteredState ()(_a .MeteredStatus ,error ){return _a .GetMeteredState ()};