Skip to content

Commit

Permalink
feta: add floating client metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
muneebkq committed Jul 12, 2024
1 parent 2781d3c commit 0177a33
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lexfloatclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
15 changes: 15 additions & 0 deletions lexfloatclient/LexFloatClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0177a33

Please sign in to comment.