Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAddress(address string) error
- func ConvertStringToReflectValues(inputs []string) []reflect.Value
- func DelaySeconds(seconds uint) bool
- func Forever()
- func GenerateTLSCertificates(namePrefix string) error
- func GetCommonByteDifference(b [][]byte) ([]byte, error)
- func GetCurrentDir() (string, error)
- func GetCurrentTime() time.Time
- func GetExtIPAddrWithUPnP() (string, error)
- func GetExtIPAddrWithoutUPnP() (string, error)
- func InterfaceFromBytes(data []byte, buffer interface{}) (interface{}, error)
- func MarshalInterfaceToMap(object interface{}) (map[string]string, error)
- func ParseShardAddress(address string) ([]string, error)
- func ParseStringMethodCall(input string) (string, string, []string, error)
- func ParseStringParams(input string) ([]string, error)
- func Print(i interface{})
- func Printf(format string, i ...interface{})
- func Println(i interface{})
- func ReadConnectionAsync(conn *tls.Conn, buffer chan []byte, finished chan bool, err chan error)
- func ReadConnectionDelim(conn *tls.Conn) ([]byte, error)
- func ReadConnectionWaitAsync(conn *tls.Conn) ([]byte, error)
- func ReadConnectionWaitAsyncNoTLS(conn net.Conn) ([]byte, error)
- func ReadGob(filePath string, object interface{}) error
- func SafeSlice(b []byte) string
- func SeedAddress(seeds []string, shardID string) (string, error)
- func SendBytes(b []byte, address string) error
- func SendBytesAsync(b []byte, address string, finished *[]bool) error
- func SendBytesAsyncRoutine(b []byte, address string, finished chan bool) error
- func SendBytesNoTLS(b []byte, address string) error
- func SendBytesResult(b []byte, address string) ([]byte, error)
- func SendBytesResultBufferAsync(b []byte, buffer *[][]byte, address string) error
- func SendBytesReusable(b []byte, address string) (*tls.Conn, error)
- func SendBytesWithConnection(connection *tls.Conn, b []byte) error
- func SerializeToBytes(object interface{}) ([]byte, error)
- func SerializeToString(object interface{}) (string, error)
- func Sha3(b []byte) string
- func StringFetchCallReceiver(input string) string
- func StringInSlice(s []string, v string) bool
- func StringStripParentheses(input string) string
- func StringStripReceiverCall(input string) string
- func UnmarshalInterfaceFromMap(object map[string]interface{}) (interface{}, error)
- func UnmarshalInterfaceFromStringMap(buffer interface{}, object map[string]string) (interface{}, error)
- func WriteGob(filePath string, object interface{}) error
Constants ¶
const ( // NodeAvailableRep - global definition for reputation value of node availability NodeAvailableRep = 10 // GoP2PTestnetID - GoP2P testing network identifier GoP2PTestnetID = 4519161392015 // ConnectionDelimiter - GoP2P standard connection delimiter ConnectionDelimiter = byte('\f') // ProtobufPrefix - GoP2P standard protobuf message prefix ProtobufPrefix = "ProtoID" )
Variables ¶
var ( // ExtIPProviders - preset macro defining list of available external IP checking services ExtIPProviders = []string{"http://checkip.amazonaws.com/", "http://icanhazip.com/", "http://www.trackip.net/ip", "http://bot.whatismyipaddress.com/", "https://ipecho.net/plain", "http://myexternalip.com/raw"} // GeneralTLSConfig - general global GoP2P TLS Config GeneralTLSConfig = &tls.Config{ Certificates: []tls.Certificate{getTLSCerts("GoP2PGeneral")}, InsecureSkipVerify: true, ServerName: "localhost"} // Silent - silence common.Println calls Silent = false )
Functions ¶
func CheckAddress ¶
CheckAddress - check that specified IP address can be pinged, and is available on specified port
func ConvertStringToReflectValues ¶
ConvertStringToReflectValues - convert string to []reflect.Value
func DelaySeconds ¶
DelaySeconds - wait until duration passed, return true once duration completed
func GenerateTLSCertificates ¶
GenerateTLSCertificates - generate necessary TLS certificates, keys
func GetCommonByteDifference ¶
GetCommonByteDifference - attempt to fetch most similar byte array in array of byte arrays
func GetCurrentDir ¶
GetCurrentDir - returns current execution directory
func GetCurrentTime ¶
GetCurrentTime - get current time in the UTC format
func GetExtIPAddrWithUPnP ¶
GetExtIPAddrWithUPnP - retrieve the external IP address of the current machine via upnp
func GetExtIPAddrWithoutUPnP ¶
GetExtIPAddrWithoutUPnP - retrieve the external IP address of the current machine w/o upnp
func InterfaceFromBytes ¶
InterfaceFromBytes - attempt to decode specified byte array to interface
func MarshalInterfaceToMap ¶
MarshalInterfaceToMap - attempt to map interface to string map
func ParseShardAddress ¶
ParseShardAddress - attempt to fetch node addresses from shard address
func ParseStringMethodCall ¶
ParseStringMethodCall - attempt to parse string as method call, returning receiver, method name, and params
func ParseStringParams ¶
ParseStringParams - attempt to fetch string parameters from (..., ..., ...) style call
func ReadConnectionAsync ¶
ReadConnectionAsync - attempt to read entirety of specified connection in an asynchronous fashion, returning data byte value
func ReadConnectionDelim ¶
ReadConnectionDelim - attempt to read connection until occurrence of standard GoP2P connection delimiter
func ReadConnectionWaitAsync ¶
ReadConnectionWaitAsync - attempt to read from connection in an asynchronous fashion, after waiting for peer to write
func ReadConnectionWaitAsyncNoTLS ¶
ReadConnectionWaitAsyncNoTLS - attempt to read from connection in an asynchronous fashion, after waiting for peer to write
func SeedAddress ¶
SeedAddress - generated shard address from seeds
func SendBytesAsync ¶
SendBytesAsync - attempt to send specified bytes to given address in an asynchronous manner
func SendBytesAsyncRoutine ¶
SendBytesAsyncRoutine - attempt to send specified bytes to given address in an asynchronous, go routine-based manner.
func SendBytesNoTLS ¶
SendBytesNoTLS - send bytes to address without TLS
func SendBytesResult ¶
SendBytesResult - attempt to send specified bytes to given address, returning result
func SendBytesResultBufferAsync ¶
SendBytesResultBufferAsync - attempt to send specified bytes to given address in an asynchronous fashion, reading the result into a given buffer
func SendBytesReusable ¶
SendBytesReusable - attempt to send specified bytes to given address and return created connection
func SendBytesWithConnection ¶
SendBytesWithConnection - attempt to send specified bytes to given address via given connection
func SerializeToBytes ¶
SerializeToBytes - attempt to convert specified interface to byte array
func SerializeToString ¶
SerializeToString - attempt to get string representation of specified object
func StringFetchCallReceiver ¶
StringFetchCallReceiver - attempt to fetch receiver from string, as if it were a x.y(..., ..., ...) style method call
func StringInSlice ¶
StringInSlice - check if value is in slice
func StringStripParentheses ¶
StringStripParentheses - strip parantheses from string
func StringStripReceiverCall ¶
StringStripReceiverCall - strip receiver from string method call
func UnmarshalInterfaceFromMap ¶
UnmarshalInterfaceFromMap - attempt to convert specified map to interface
func UnmarshalInterfaceFromStringMap ¶
func UnmarshalInterfaceFromStringMap(buffer interface{}, object map[string]string) (interface{}, error)
UnmarshalInterfaceFromStringMap - attempt to convert specified map to interface
Types ¶
This section is empty.