32 lines
665 B
Go
Raw Normal View History

2017-07-08 22:00:11 +00:00
/*
* This file is subject to the terms and conditions defined in
* file 'LICENSE.md', which is part of this source code package.
*/
2017-07-08 23:09:52 +00:00
// The license package helps manage commercial licenses and check if they are valid for the version of unidoc used.
2017-07-08 22:00:11 +00:00
package license
// Defaults to the open source license.
var licenseKey *LicenseKey = MakeOpensourceLicenseKey()
// Sets and validates the license key.
func SetLicenseKey(content string) error {
lk, err := licenseKeyDecode(content)
if err != nil {
return err
}
err = lk.Validate()
if err != nil {
return err
}
licenseKey = &lk
return nil
}
func GetLicenseKey() *LicenseKey {
return licenseKey
}