Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add floating client metadata #10

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions lexfloatclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,28 @@ 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

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