mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-28 13:48:49 +08:00

* Add mongodb reader service Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com> * Add tests for mongodb reader service Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com> * Add documentation for mongodb reader service Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com> * Fix test function name Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com> * Update comment in docker-compose for mongodb-reader service Signed-off-by: Aleksandar Novakovic <aleksandar.novakovic@mainflux.com>
26 lines
479 B
Go
26 lines
479 B
Go
// +build appengine appenginevm
|
|
|
|
package jsonparser
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
// See fastbytes_unsafe.go for explanation on why *[]byte is used (signatures must be consistent with those in that file)
|
|
|
|
func equalStr(b *[]byte, s string) bool {
|
|
return string(*b) == s
|
|
}
|
|
|
|
func parseFloat(b *[]byte) (float64, error) {
|
|
return strconv.ParseFloat(string(*b), 64)
|
|
}
|
|
|
|
func bytesToString(b *[]byte) string {
|
|
return string(*b)
|
|
}
|
|
|
|
func StringToBytes(s string) []byte {
|
|
return []byte(s)
|
|
}
|