From 0177a335d4357d97a9252f1656294c852ad9b54f Mon Sep 17 00:00:00 2001 From: muneebkq Date: Fri, 12 Jul 2024 11:42:56 +0530 Subject: [PATCH] feta: add floating client metadata --- lexfloatclient.go | 23 +++++++++++++++++++++++ lexfloatclient/LexFloatClient.h | 15 +++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/lexfloatclient.go b/lexfloatclient.go index 0862ca6..be6e5ab 100644 --- a/lexfloatclient.go +++ b/lexfloatclient.go @@ -277,6 +277,29 @@ func GetFloatingClientMeterAttributeUses(name string, uses *uint) int { freeCString(cName) return int(status) } + +/* + FUNCTION: GetFloatingClientMetadata() + + PURPOSE: 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 buffer that receives the value of the string + * length - size of the buffer pointed to by the value parameter + + RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, + LF_E_METADATA_KEY_NOT_FOUND +*/ +func GetFloatingClientMetadata(key string, value *string) int { + cKey := goToCString(key) + var cValue = getCArray() + status := C.GetFloatingClientMetadata(cKey, &cValue[0], maxCArrayLength) + *value = ctoGoString(&cValue[0]) + freeCString(cKey) + return int(status) + +} /* FUNCTION: RequestFloatingLicense() diff --git a/lexfloatclient/LexFloatClient.h b/lexfloatclient/LexFloatClient.h index 619e290..1961ae9 100644 --- a/lexfloatclient/LexFloatClient.h +++ b/lexfloatclient/LexFloatClient.h @@ -233,6 +233,21 @@ LEXFLOATCLIENT_API int LF_CC GetHostLicenseExpiryDate(uint32_t *expiryDate); */ LEXFLOATCLIENT_API int LF_CC GetFloatingClientMeterAttributeUses(CSTRTYPE name, uint32_t *uses); +/* + FUNCTION: GetFloatingClientMetadata() + + PURPOSE: 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 buffer that receives the value of the string + * length - size of the buffer pointed to by the value parameter + + RETURN CODES: LF_OK, LF_E_PRODUCT_ID, LF_E_NO_LICENSE, LF_E_BUFFER_SIZE, + LF_E_METADATA_KEY_NOT_FOUND +*/ +LEXFLOATCLIENT_API int LF_CC GetFloatingClientMetadata(CSTRTYPE key, STRTYPE value, uint32_t length); + /* FUNCTION: RequestFloatingLicense()