some touchups (version, call return)
This commit is contained in:
5
arma.go
5
arma.go
@@ -29,7 +29,7 @@ func runExtensionCallback(name *C.char, function *C.char, data *C.char) C.int {
|
||||
|
||||
//export goRVExtensionVersion
|
||||
func goRVExtensionVersion(output *C.char, outputsize C.size_t) {
|
||||
result := C.CString("Version 1.0")
|
||||
result := C.CString("Version 0.0.1")
|
||||
defer C.free(unsafe.Pointer(result))
|
||||
var size = C.strlen(result) + 1
|
||||
if size > outputsize {
|
||||
@@ -151,7 +151,7 @@ func goRVExtension(output *C.char, outputsize C.size_t, input *C.char) {
|
||||
go callBackExample()
|
||||
} else {
|
||||
// Return a result through callextension Arma call
|
||||
temp := fmt.Sprintf("Cavmetrics: %s", C.GoString(input))
|
||||
temp := fmt.Sprintf("Rangermetrics: %s", C.GoString(input))
|
||||
result := C.CString(temp)
|
||||
defer C.free(unsafe.Pointer(result))
|
||||
var size = C.strlen(result) + 1
|
||||
@@ -159,6 +159,7 @@ func goRVExtension(output *C.char, outputsize C.size_t, input *C.char) {
|
||||
size = outputsize
|
||||
}
|
||||
|
||||
// start a goroutine to send the data to influx
|
||||
go sendToInflux(C.GoString(input))
|
||||
|
||||
C.memmove(unsafe.Pointer(output), unsafe.Pointer(result), size)
|
||||
|
||||
Reference in New Issue
Block a user