Documentation
¶
Index ¶
- func ArrayContains(arr []string, item string) bool
- func ArrayContainsIndex(arr []string, item string) (bool, int)
- func ByteToInt64(arr string) int64
- func BytesToIP(encoded_ip []byte) string
- func Contains(s interface{}, elem interface{}) bool
- func Copy(src, dst string) error
- func CreateSig(data string, key ecdsa.PrivateKey) string
- func DecodeIP(remote_ip string) string
- func DecodeJWK(jwkType types.Jwk) (string, *ecdsa.PublicKey, error)
- func DecodePubKey(tx types.Tx) (*ecdsa.PublicKey, error)
- func DecodeTx(incoming []byte) (types.Tx, error)
- func DecodeTxAndVerifySig(incoming []byte, CoreKeys map[string]ecdsa.PublicKey) (types.Tx, error)
- func DetermineIP(peer core_types.Peer) string
- func EncodeTx(outgoing types.Tx) string
- func EncodeTxWithKey(outgoing types.Tx, privateKey *ecdsa.PrivateKey) string
- func GenerateKey(privateKey *ecdsa.PrivateKey, kid string) types.Jwk
- func GetAPIStatus(ip string) types.CoreAPIStatus
- func GetClientIP(r *http.Request) string
- func GetCurrentFuncName(numCallStack int) string
- func GetEnv(key string, def string) string
- func GetIPOnly(ip string) string
- func GetNISTTimestamp(record string) int64
- func Int2Ip(nn uint32) net.IP
- func Int64ToByte(num int64) []byte
- func Ip2Int(ip net.IP) uint32
- func IsULID(proofId string) bool
- func IsUUID(proofId string) bool
- func LogError(err error) error
- func LoggerError(logger log.Logger, err error) error
- func MaxInt64(x, y int64) int64
- func NormalizeUri(uri string, removePort bool, http bool, https bool) string
- func ReadContractJSON(file string, testnet bool) string
- func ReadLines(path string) ([]string, error)
- func ReverseTxHex(str string) string
- func UUIDFromHash(seedBytes []byte) (uuid.UUID, error)
- func UniquifyAddresses(s []common.Address) []common.Address
- func UniquifyStrings(s []string) []string
- func ValidateIPAddress(ip string) error
- func VerifySig(data string, originalSig string, key ecdsa.PublicKey) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayContains ¶
func ByteToInt64 ¶
ByteToInt64 : Convert a byte array from tendermint back into an int64
func BytesToIP ¶
BytesToIP : takes an IP byte array and converts it to corresponding dot string format
func Contains ¶
func Contains(s interface{}, elem interface{}) bool
Contains : generic method for testing set (slice) inclusion
func CreateSig ¶
func CreateSig(data string, key ecdsa.PrivateKey) string
CreateSig : create signature from data in base64
func DecodeTx ¶
DecodeTxAndVerifySig accepts a Chainpoint Calendar transaction in base64 and decodes it into abci.Tx struct
func DecodeTxAndVerifySig ¶
DecodeTxAndVerifySig accepts a Chainpoint Calendar transaction in base64 and decodes it into abci.Tx struct
func DetermineIP ¶
func DetermineIP(peer core_types.Peer) string
DetermineIP : use remoteIP if routable, use listenAddr if not
func EncodeTxWithKey ¶
func EncodeTxWithKey(outgoing types.Tx, privateKey *ecdsa.PrivateKey) string
EncodeTxWithKey : Encodes a Tendermint transaction to base64
func GenerateKey ¶
func GenerateKey(privateKey *ecdsa.PrivateKey, kid string) types.Jwk
func GetAPIStatus ¶
func GetAPIStatus(ip string) types.CoreAPIStatus
GetAPIStatus : get metadata from a core, given its IP
func GetClientIP ¶
func GetCurrentFuncName ¶
GetCurrentFuncName : get name of function being called
func GetNISTTimestamp ¶
GetNISTTimestamp : gets Unix timestamp from record
func Int64ToByte ¶
Int64ToByte : Convert an int64 to a byte for use in the Tendermint tagging system
func LoggerError ¶
LoggerError : Log error if it exists using a logger
func ReadContractJSON ¶
ReadContractJSON : reads in TierionNetworkToken and ChainpointRegistry json files and extracts addresses
func ReverseTxHex ¶
func UUIDFromHash ¶
UUIDFromHash : generate a uuid from a byte hash, must be 16 bytes
func UniquifyAddresses ¶
UniquifyAddresses: make unique array of addresses
func UniquifyStrings ¶
UniquifyStrings : make unique array of strings
func ValidateIPAddress ¶
Types ¶
This section is empty.