...
Documentation
Documentation

# Package license

## Overview ▹

## Overview ▾

Package license helps manage commercial licenses and check if they are valid for the version of UniOffice used.

## Index ▹

## Index ▾

### Package files

key.go metered.go

## Constants

License tiers.

    const (
        LicenseTierUnlicensed = license.LicenseTierUnlicensed
        LicenseTierCommunity  = license.LicenseTierCommunity
        LicenseTierIndividual = license.LicenseTierIndividual
        LicenseTierBusiness   = license.LicenseTierBusiness
    )

## func GetMeteredState ¶

    func GetMeteredState() (license.MeteredStatus, error)

GetMeteredState checks the currently used metered document usage status, documents used and credits available.

## func SetLicenseKey ¶

    func SetLicenseKey(content string, customerName string) error

SetLicenseKey sets and validates the license key.

## func SetMeteredKey ¶

    func SetMeteredKey(apiKey string) error

SetMeteredKey sets the metered License API key required for SaaS operation. Document usage is reported periodically for the product to function correctly.

## func SetMeteredKeyPersistentCache ¶

    func SetMeteredKeyPersistentCache(val bool)

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 SetMeteredKeyUsageLogVerboseMode ¶

    func SetMeteredKeyUsageLogVerboseMode(val bool)

SetMeteredKeyUsageLogVerboseMode sets the metered License API Key usage log verbose mode. Default value `false`, set to `true` will log the credit usages and print out to console with log level INFO.

## type LegacyLicense ¶

LegacyLicense holds the old-style unioffice license information.

    type LegacyLicense = license.LegacyLicense

## type LegacyLicenseType ¶

LegacyLicenseType is the type of license

    type LegacyLicenseType = license.LegacyLicenseType

## type LicenseKey ¶

LicenseKey represents a loaded license key.

    type LicenseKey = license.LicenseKey

### func GetLicenseKey ¶

    func GetLicenseKey() *LicenseKey

GetLicenseKey returns the currently loaded license key.

### func MakeUnlicensedKey ¶

    func MakeUnlicensedKey() *LicenseKey

MakeUnlicensedKey returns a default key.