Documentation ¶
Index ¶
- func BytesToInt(b []byte) int
- func BytesToUint32(b []byte) uint32
- func BytesToUint64(b []byte) uint64
- func ChainMemberStatusValidateWithCertMode(chainId string, memberStatusValidator *common.MemberStatusValidator, ...) (passed bool, err error)
- func ChainMemberStatusValidateWithPubKeyMode(chainId string, memberStatusValidator *common.MemberStatusValidator, ...) (passed bool, err error)
- func CreateProtocolWithChainIdAndFlag(chainId, flag string) string
- func CurrentTimeMillisSeconds() int64
- func CurrentTimeSeconds() int64
- func FibonacciArray(n int) []int64
- func GZipCompressBytes(data []byte) ([]byte, error)
- func GZipDeCompressBytes(data []byte) ([]byte, error)
- func GetChainIdAndFlagWithProtocol(p string) (chainId, flag string)
- func IntToBytes(n int) []byte
- func MemberStatusValidateWithCertMode(memberStatusValidator *common.MemberStatusValidator, certBytes []byte) (chainIds []string, passed bool, err error)
- func MemberStatusValidateWithPubKeyMode(memberStatusValidator *common.MemberStatusValidator, pubKeyBytes []byte) (chainIds []string, passed bool, err error)
- func ParseAddrInfo(addrs []string) ([]peer.AddrInfo, error)
- func ParseMultiAddrs(addrs []string) ([]multiaddr.Multiaddr, error)
- func Uint32ToBytes(n uint32) []byte
- func Uint64ToBytes(n uint64) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToInt ¶
BytesToInt . @Description: parse 8 bytes to an int value. @param b @return int
func BytesToUint32 ¶
BytesToUint32 . @Description: parse 4 bytes to uint32. @param b @return uint32
func BytesToUint64 ¶
BytesToUint64 . @Description: parse 8 bytes to uint64. @param b @return uint64
func ChainMemberStatusValidateWithCertMode ¶
func ChainMemberStatusValidateWithCertMode( chainId string, memberStatusValidator *common.MemberStatusValidator, certBytes []byte) (passed bool, err error)
ChainMemberStatusValidateWithCertMode . @Description: check the member status in the cert mode with the chain @param chainId @param memberStatusValidator @param certBytes @return passed @return err
func ChainMemberStatusValidateWithPubKeyMode ¶
func ChainMemberStatusValidateWithPubKeyMode( chainId string, memberStatusValidator *common.MemberStatusValidator, pubKeyBytes []byte) (passed bool, err error)
ChainMemberStatusValidateWithPubKeyMode . @Description: check the member status in the public key mode with the chain @param chainId @param memberStatusValidator @param pubKeyBytes @return passed @return err
func CreateProtocolWithChainIdAndFlag ¶
CreateProtocolWithChainIdAndFlag . @Description: will create a protocol string with a chain id string and a message flag string. @param chainId @param flag @return string
func CurrentTimeMillisSeconds ¶
func CurrentTimeMillisSeconds() int64
CurrentTimeMillisSeconds . @Description: return current unix timestamp in milliseconds @return int64
func CurrentTimeSeconds ¶
func CurrentTimeSeconds() int64
CurrentTimeSeconds . @Description: return current unix timestamp in seconds @return int64
func FibonacciArray ¶
FibonacciArray . @Description: create a fibonacci array with length n. @param n @return []int64
func GZipCompressBytes ¶
GZipCompressBytes . @Description: compress bytes with GZip(BestSpeed mode). @param data @return []byte @return error
func GZipDeCompressBytes ¶
GZipDeCompressBytes . @Description: decompress bytes with GZip. @param data @return []byte @return error
func GetChainIdAndFlagWithProtocol ¶
GetChainIdAndFlagWithProtocol . @Description: will load the chain id string and the message flag string from a protocol string. @param p @return chainId @return flag
func IntToBytes ¶
IntToBytes . @Description: parse an int value to 8 bytes. @param n @return []byte
func MemberStatusValidateWithCertMode ¶
func MemberStatusValidateWithCertMode( memberStatusValidator *common.MemberStatusValidator, certBytes []byte) (chainIds []string, passed bool, err error)
MemberStatusValidateWithCertMode . @Description: check the member status in the cert mode @param memberStatusValidator @param certBytes @return chainIds @return passed @return err
func MemberStatusValidateWithPubKeyMode ¶
func MemberStatusValidateWithPubKeyMode( memberStatusValidator *common.MemberStatusValidator, pubKeyBytes []byte) (chainIds []string, passed bool, err error)
MemberStatusValidateWithPubKeyMode . @Description: check the member status in the public key mode @param memberStatusValidator @param pubKeyBytes @return chainIds @return passed @return err
func ParseAddrInfo ¶
ParseAddrInfo . @Description: parse multi addr string to peer.AddrInfo . @param addrs @return []peer.AddrInfo @return error
func ParseMultiAddrs ¶
ParseMultiAddrs . @Description: parse multi addr string to multiaddr.Multiaddr . @param addrs @return []multiaddr.Multiaddr @return error
func Uint32ToBytes ¶
Uint32ToBytes . @Description: parse uint32 to 4 bytes. @param n @return []byte
Types ¶
This section is empty.