Documentation
¶
Index ¶
- Constants
- func DecrementFloatingClientMeterAttributeUses(name string, decrement uint) int
- func DropFloatingLicense() int
- func GetFloatingClientLeaseExpiryDate(leaseExpiryDate *uint) int
- func GetFloatingClientLibraryVersion(libraryVersion *string) int
- func GetFloatingClientMetadata(key string, value *string) int
- func GetFloatingClientMeterAttributeUses(name string, uses *uint) int
- func GetFloatingLicenseMode(mode *string) int
- func GetHostConfig(hostConfig *HostConfig) int
- func GetHostFeatureEntitlement(name string, hostFeatureEntitlement *HostFeatureEntitlement) int
- func GetHostFeatureEntitlements(hostFeatureEntitlements *[]HostFeatureEntitlement) int
- func GetHostLicenseEntitlementSetDisplayName(displayName *string) int
- func GetHostLicenseEntitlementSetName(name *string) int
- func GetHostLicenseEntitlementSetTier(tier *int64) int
- func GetHostLicenseExpiryDate(expiryDate *uint) int
- func GetHostLicenseMetadata(key string, value *string) int
- func GetHostLicenseMeterAttribute(name string, allowedUses *int64, totalUses *uint64, grossUses *uint64) int
- func GetHostProductMetadata(key string, value *string) int
- func GetHostProductVersionDisplayName(displayName *string) intdeprecated
- func GetHostProductVersionFeatureFlag(name string, enabled *bool, data *string) intdeprecated
- func GetHostProductVersionName(name *string) intdeprecated
- func HasFloatingLicense() int
- func IncrementFloatingClientMeterAttributeUses(name string, increment uint) int
- func RequestFloatingLicense() int
- func RequestOfflineFloatingLicense(leaseDuration uint) int
- func ResetFloatingClientMeterAttributeUses(name string) int
- func SetFloatingClientMetadata(key string, value string) int
- func SetFloatingLicenseCallback(callbackFunction func(int)) int
- func SetHostProductId(productId string) int
- func SetHostUrl(hostUrl string) int
- func SetPermissionFlag(flags uint) int
- type HostConfig
- type HostFeatureEntitlement
Constants ¶
const ( LF_USER uint = 10 LF_ALL_USERS uint = 11 )
const ( // Success code. LF_OK int = 0 // Failure code. LF_FAIL int = 1 // The product id is incorrect. LF_E_PRODUCT_ID int = 40 // Invalid or missing callback function. LF_E_CALLBACK int = 41 // Missing or invalid server url. LF_E_HOST_URL int = 42 // Ensure system date and time settings are correct. LF_E_TIME int = 43 // Failed to connect to the server due to network error. LF_E_INET int = 44 // License has not been leased yet. LF_E_NO_LICENSE int = 45 // License has already been leased. LF_E_LICENSE_EXISTS int = 46 // License does not exist on server or has already expired. This // happens when the request to refresh the license is delayed. LF_E_LICENSE_NOT_FOUND int = 47 // License lease has expired due to network error. This // happens when the request to refresh the license fails due to // network error. LF_E_LICENSE_EXPIRED_INET int = 48 // The server has reached it's allowed limit of floating licenses. LF_E_LICENSE_LIMIT_REACHED int = 49 // The buffer size was smaller than required. LF_E_BUFFER_SIZE int = 50 // The metadata key does not exist. LF_E_METADATA_KEY_NOT_FOUND int = 51 // Metadata key length is more than 256 characters. LF_E_METADATA_KEY_LENGTH int = 52 // Metadata value length is more than 4096 characters. LF_E_METADATA_VALUE_LENGTH int = 53 // The floating client has reached it's metadata fields limit. LF_E_FLOATING_CLIENT_METADATA_LIMIT int = 54 // The meter attribute does not exist. LF_E_METER_ATTRIBUTE_NOT_FOUND int = 55 // The meter attribute has reached it's usage limit. LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED int = 56 // No product version is linked with the license. LF_E_PRODUCT_VERSION_NOT_LINKED int = 57 // The product version feature flag does not exist. LF_E_FEATURE_FLAG_NOT_FOUND int = 58 // Insufficient system permissions. LF_E_SYSTEM_PERMISSION int = 59 // IP address is not allowed. LF_E_IP int = 60 // Invalid permission flag. LF_E_INVALID_PERMISSION_FLAG int = 61 // Offline floating license is not allowed for per-instance leasing strategy. LF_E_OFFLINE_FLOATING_LICENSE_NOT_ALLOWED int = 62 // Maximum offline lease duration exceeded. LF_E_MAX_OFFLINE_LEASE_DURATION_EXCEEDED int = 63 // Allowed offline floating clients limit reached. LF_E_ALLOWED_OFFLINE_FLOATING_CLIENTS_LIMIT_REACHED int = 64 // Fingerprint couldn't be generated because Windows Management // Instrumentation (WMI) service has been disabled. This error is specific // to Windows only. LF_E_WMIC int = 65 // Machine fingerprint has changed since activation. LF_E_MACHINE_FINGERPRINT int = 66 // Request blocked due to untrusted proxy. LF_E_PROXY_NOT_TRUSTED int = 67 // No entitlement set is linked to the license. LF_E_ENTITLEMENT_SET_NOT_LINKED int = 68 // The feature entitlement does not exist. LF_E_FEATURE_ENTITLEMENT_NOT_FOUND int = 69 // Client error. LF_E_CLIENT int = 70 // Server error. LF_E_SERVER int = 71 // System time on server has been tampered with. Ensure // your date and time settings are correct on the server machine. LF_E_SERVER_TIME_MODIFIED int = 72 // The server has not been activated using a license key. LF_E_SERVER_LICENSE_NOT_ACTIVATED int = 73 // The server license has expired. LF_E_SERVER_LICENSE_EXPIRED int = 74 // The server license has been suspended. LF_E_SERVER_LICENSE_SUSPENDED int = 75 // The grace period for server license is over. LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER int = 76 // Requested offline lease duration exceeds server license expiry date. LF_E_LEASE_EXCEEDS_SERVER_LICENSE_EXPIRY int = 77 )
int enumeration from lexfloatclient/int.h int =4
Variables ¶
This section is empty.
Functions ¶
func DecrementFloatingClientMeterAttributeUses ¶
DecrementFloatingClientMeterAttributeUses decrements the meter attribute uses of the floating client.
Parameters: - name: name of the meter attribute - decrement: the decrement value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_HOST_URL, LF_E_METER_ATTRIBUTE_NOT_FOUND, LF_E_INET, LF_E_LICENSE_NOT_FOUND, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED, LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED
func DropFloatingLicense ¶
func DropFloatingLicense() int
DropFloatingLicense sends the request to the LexFloatServer to free the license.
Call this function before you exit your application to prevent zombie licenses.
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_HOST_URL, LF_E_CALLBACK, LF_E_INET, LF_E_LICENSE_NOT_FOUND, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED
func GetFloatingClientLeaseExpiryDate ¶
GetFloatingClientLeaseExpiryDate gets the lease expiry date timestamp of the floating client.
Parameters: - leaseExpiryDate: pointer to the integer that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE
func GetFloatingClientLibraryVersion ¶
GetFloatingClientLibraryVersion gets the version of this library.
Parameters: - libraryVersion: pointer to a string that receives the value
Returns: LF_OK, LF_E_BUFFER_SIZE
func GetFloatingClientMetadata ¶
GetFloatingClientMetadata gets the value of the floating client metadata.
Parameters: - key: key of the metadata field whose value you want to retrieve - value: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_METADATA_KEY_NOT_FOUND
func GetFloatingClientMeterAttributeUses ¶
GetFloatingClientMeterAttributeUses gets the meter attribute uses consumed by the floating client.
Parameters: - name: name of the meter attribute - uses: pointer to the integer that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_METER_ATTRIBUTE_NOT_FOUND
func GetFloatingLicenseMode ¶
GetFloatingLicenseMode gets the mode of the floating license (online or offline).
Parameters: - mode: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE
func GetHostConfig ¶
func GetHostConfig(hostConfig *HostConfig) int
GetHostConfig gets the host configuration.
This function sends a network request to LexFloatServer to get the configuration details. Parameters: - hostConfig: pointer to the HostConfig struct that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_HOST_URL, LF_E_BUFFER_SIZE, LF_E_INET, LF_E_CLIENT, LF_E_IP, LF_E_SERVER
func GetHostFeatureEntitlement ¶
func GetHostFeatureEntitlement(name string, hostFeatureEntitlement *HostFeatureEntitlement) int
GetHostFeatureEntitlement gets the value of the feature entitlement field associated with the LexFloatServer license.
Parameters: - name: name of the feature - hostFeatureEntitlement: pointer to the HostFeatureEntitlement struct that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_FEATURE_ENTITLEMENT_NOT_FOUND
func GetHostFeatureEntitlements ¶
func GetHostFeatureEntitlements(hostFeatureEntitlements *[]HostFeatureEntitlement) int
GetHostFeatureEntitlements gets the feature entitlements associated with the LexFloatServer license.
Parameters: - hostFeatureEntitlements: pointer to an array of HostFeatureEntitlement structs that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE
func GetHostLicenseEntitlementSetDisplayName ¶
GetHostLicenseEntitlementSetDisplayName gets the display name of the entitlement set associated with the LexFloatServer license.
Parameters: - displayName: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_ENTITLEMENT_SET_NOT_LINKED
func GetHostLicenseEntitlementSetName ¶
GetHostLicenseEntitlementSetName gets the name of the entitlement set associated with the LexFloatServer license.
Parameters: - name: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_ENTITLEMENT_SET_NOT_LINKED
func GetHostLicenseEntitlementSetTier ¶
GetHostLicenseEntitlementSetTier gets the tier of the entitlement set associated with the LexFloatServer license.
Parameters: - tier: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_ENTITLEMENT_SET_NOT_LINKED
func GetHostLicenseExpiryDate ¶
GetHostLicenseExpiryDate gets the license expiry date timestamp of the LexFloatServer license.
Parameters: - expiryDate: pointer to the integer that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE
func GetHostLicenseMetadata ¶
GetHostLicenseMetadata gets the value of the license metadata field associated with the LexFloatServer license.
Parameters: - key: key of the metadata field whose value you want to get - value: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_METADATA_KEY_NOT_FOUND
func GetHostLicenseMeterAttribute ¶
func GetHostLicenseMeterAttribute(name string, allowedUses *int64, totalUses *uint64, grossUses *uint64) int
GetHostLicenseMeterAttribute gets the license meter attribute allowed uses and total uses associated with the LexFloatServer license.
Parameters: - name: name of the meter attribute - allowedUses: pointer to the integer that receives the value. A value of -1 indicates unlimited allowed uses. - totalUses: pointer to the integer that receives the value - grossUses: pointer to the integer that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_METER_ATTRIBUTE_NOT_FOUND
func GetHostProductMetadata ¶
GetHostProductMetadata gets the value of the product metadata.
Parameters: - key: key of the metadata field whose value you want to get - value: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, LF_E_METADATA_KEY_NOT_FOUND
func GetHostProductVersionDisplayName
deprecated
GetHostProductVersionDisplayName gets the product version display name.
Deprecated: This function is deprecated. Use GetHostLicenseEntitlementSetDisplayName() instead.
Parameters: - displayName: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_PRODUCT_VERSION_NOT_LINKED, LF_E_BUFFER_SIZE
func GetHostProductVersionFeatureFlag
deprecated
GetHostProductVersionFeatureFlag gets the product version feature flag.
Deprecated: This function is deprecated. Use GetHostFeatureEntitlement() instead.
Parameters: - name: name of the feature flag - enabled: pointer to the integer that receives the value - 0 or 1 - data: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_PRODUCT_VERSION_NOT_LINKED, LF_E_FEATURE_FLAG_NOT_FOUND, LF_E_BUFFER_SIZE
func GetHostProductVersionName
deprecated
GetHostProductVersionName gets the product version name.
Deprecated: This function is deprecated. Use GetHostLicenseEntitlementSetName() instead.
Parameters: - name: pointer to a string that receives the value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_PRODUCT_VERSION_NOT_LINKED, LF_E_BUFFER_SIZE
func HasFloatingLicense ¶
func HasFloatingLicense() int
HasFloatingLicense checks whether any license has been leased or not. If yes, it returns LF_OK.
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE
func IncrementFloatingClientMeterAttributeUses ¶
IncrementFloatingClientMeterAttributeUses increments the meter attribute uses of the floating client.
Parameters: - name: name of the meter attribute - increment: the increment value
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_HOST_URL, LF_E_METER_ATTRIBUTE_NOT_FOUND, LF_E_INET, LF_E_LICENSE_NOT_FOUND, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_METER_ATTRIBUTE_USES_LIMIT_REACHED, LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED
func RequestFloatingLicense ¶
func RequestFloatingLicense() int
RequestFloatingLicense sends the request to lease the license from the LexFloatServer.
Returns: LF_OK, LF_FAIL, LF_E_PRODUCT_ID, LF_E_LICENSE_EXISTS, LF_E_HOST_URL, LF_E_CALLBACK, LF_E_LICENSE_LIMIT_REACHED, LF_E_INET, LF_E_TIME, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED
func RequestOfflineFloatingLicense ¶
RequestOfflineFloatingLicense sends the request to lease the license from the LexFloatServer for offline usage.
The maximum value of lease duration is configured in the config.yml of LexFloatServer ¶
Parameters: - leaseDuration: value of the lease duration.
Returns: LF_OK, LF_FAIL, LF_E_PRODUCT_ID, LF_E_LICENSE_EXISTS, LF_E_HOST_URL, LF_E_LICENSE_LIMIT_REACHED, LF_E_INET, LF_E_TIME, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED, LF_E_WMIC, LF_E_SYSTEM_PERMISSION, LF_E_LEASE_EXCEEDS_SERVER_LICENSE_EXPIRY
func ResetFloatingClientMeterAttributeUses ¶
ResetFloatingClientMeterAttributeUses resets the meter attribute uses consumed by the floating client.
Parameters: - name: name of the meter attribute
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_HOST_URL, LF_E_METER_ATTRIBUTE_NOT_FOUND, LF_E_INET, LF_E_LICENSE_NOT_FOUND, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_SERVER_LICENSE_NOT_ACTIVATED, LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER, LF_E_SERVER_LICENSE_EXPIRED
func SetFloatingClientMetadata ¶
SetFloatingClientMetadata sets the floating client metadata.
The metadata appears along with the license details of the license in LexFloatServer dashboard.
Parameters: - key: string of maximum length 256 characters with utf-8 encoding. - value: string of maximum length 4096 characters with utf-8 encoding.
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_METADATA_KEY_LENGTH, LF_E_METADATA_VALUE_LENGTH, LF_E_ACTIVATION_METADATA_LIMIT
func SetFloatingLicenseCallback ¶
SetFloatingLicenseCallback sets the renew license callback function.
Whenever the license lease is about to expire, a renew request is sent to the server. When the request completes, the license callback function gets invoked with one of the following status codes:
LF_OK, LF_E_INET, LF_E_LICENSE_EXPIRED_INET, LF_E_LICENSE_NOT_FOUND, LF_E_CLIENT, LF_E_IP, LF_E_SERVER, LF_E_TIME, LF_E_SERVER_LICENSE_NOT_ACTIVATED,LF_E_SERVER_TIME_MODIFIED, LF_E_SERVER_LICENSE_SUSPENDED, LF_E_SERVER_LICENSE_EXPIRED, LF_E_SERVER_LICENSE_GRACE_PERIOD_OVER
Returns: LF_OK, LF_E_PRODUCT_ID
func SetHostProductId ¶
SetHostProductId sets the product id of your application.
Parameters:
- productId: the unique product id of your application as mentioned on the product page in the dashboard.
Returns: LF_OK, LF_E_PRODUCT_ID
func SetHostUrl ¶
SetHostUrl sets the network address of the LexFloatServer.
The url format should be: http://[ip or hostname]:[port]
Parameters: - hostUrl: the url string having the correct format
Returns: LF_OK, LF_E_PRODUCT_ID, LF_E_HOST_URL
func SetPermissionFlag ¶
SetPermissionFlag sets the permission flag.
This function must be called on every start of your program after SetHostProductId() function in case the application allows borrowing of licenses or system wide activation.
Parameters: - flags: depending on your application's requirements, choose one of the following values:
- LF_USER: This flag indicates that the application does not require admin or root permissions to run.
- LF_ALL_USERS: This flag is specifically designed for Windows and should be used for system-wide activations.
Returns: LF_OK, LF_E_PRODUCT_ID
Types ¶
type HostConfig ¶
type HostConfig struct {
MaxOfflineLeaseDuration int `json:"maxOfflineLeaseDuration"`
}