diff options
Diffstat (limited to 'unipdf/internal/license/license.go')
| -rw-r--r-- | unipdf/internal/license/license.go | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/unipdf/internal/license/license.go b/unipdf/internal/license/license.go new file mode 100644 index 0000000..1db1686 --- /dev/null +++ b/unipdf/internal/license/license.go @@ -0,0 +1,89 @@ +// +// 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 + +import ( + "time" +) + +func MakeUnlicensedKey() *LicenseKey { + _ade := LicenseKey{} + _ade.CustomerName = "\u0055\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064" + _ade.Tier = LicenseTierBusiness + _ade.CreatedAt = time.Now().UTC() + _ade.CreatedAtInt = _ade.CreatedAt.Unix() + return &_ade +} + +const ( + LicenseTierUnlicensed = "\u0075\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064" + LicenseTierCommunity = "\u0063o\u006d\u006d\u0075\u006e\u0069\u0074y" + LicenseTierIndividual = "\u0069\u006e\u0064\u0069\u0076\u0069\u0064\u0075\u0061\u006c" + LicenseTierBusiness = "\u0062\u0075\u0073\u0069\u006e\u0065\u0073\u0073" +) + +var currlicence = MakeUnlicensedKey() + +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"` + UniHTML bool `json:"unihtml"` + Trial bool `json:"trial"` +} + +func (lic *LicenseKey) Validate() error { return nil } +func (lic *LicenseKey) IsLicensed() bool { return true } +func (lic *LicenseKey) ToString() string { return "ThE UUUULtimate LICENCE" } + +func SetMeteredKey(apiKey string) error { + currlicence = MakeUnlicensedKey() + return nil +} +func SetLicenseKey(content string, customerName string) error { + currlicence = MakeUnlicensedKey() + return nil +} + +func GetLicenseKey() *LicenseKey { + if currlicence == nil { + return nil + } + _gbd := *currlicence + return &_gbd +} + +func (lic *LicenseKey) TypeToString() string { return "Commercial License - Business" } + +type MeteredStatus struct { + OK bool + Credits int64 + Used int64 +} + +func GetMeteredState() (MeteredStatus, error) { + return MeteredStatus{OK: true, Credits: 9999999999999, Used: 0}, nil +} +func SetMeteredKeyUsageLogVerboseMode(val bool) {} +func SetMeteredKeyPersistentCache(val bool) {} +func TrackUse(_ string) {} +func Track(_, _, _ string) error { return nil } |
