Dmitry eeca435064 Add rendezvous implementation for discovery interface
Update vendor

Integrate rendezvous into status node

Add a test with failover using rendezvous

Use multiple servers in client

Use discovery V5 by default and test that node can be started with rendezvous discovet

Fix linter

Update rendezvous client to one with instrumented stream

Address feedback

Fix test with updated topic limits

Apply several suggestions

Change log to debug for request errors because we continue execution

Remove web3js after rebase

Update rendezvous package
2018-07-25 15:10:57 +03:00

44 lines
693 B
Go

package endian
import (
"encoding/binary"
"unsafe"
)
//保存机器大小端
var Endian binary.ByteOrder
var bigEndian bool
func IsBigEndian() bool {
return bigEndian
}
func IsLittleEndian() bool {
return !bigEndian
}
func init() {
if getEndian() {
Endian = binary.BigEndian
bigEndian = true
} else {
Endian = binary.LittleEndian
bigEndian = false
}
}
//以下代码判断机器大小端
const INT_SIZE int = int(unsafe.Sizeof(0))
//true = big endian, false = little endian
func getEndian() (ret bool) {
var i int = 0x1
bs := (*[INT_SIZE]byte)(unsafe.Pointer(&i))
if bs[0] == 0 {
return true
} else {
return false
}
}