Documentation ¶
Overview ¶
Contains resources or utils for test units
Index ¶
- func CreateHost(t *testing.T, opts ...config.Option) (host.Host, int, *ecdsa.PrivateKey)
- func CreateWakuMessage(contentTopic string, timestamp *int64, optionalPayload ...string) *pb.WakuMessage
- func ExtractIP(addr multiaddr.Multiaddr) (*net.TCPAddr, error)
- func FindFreePort(t *testing.T, host string, maxAttempts int) (int, error)
- func FindFreeUDPPort(t *testing.T, host string, maxAttempts int) (int, error)
- func GenerateRandomASCIIString(minLength int, maxLength int) (string, error)
- func GenerateRandomBase64String(length int) (string, error)
- func GenerateRandomJSONString() (string, error)
- func GenerateRandomSQLInsert() (string, error)
- func GenerateRandomURLEncodedString(length int) (string, error)
- func GenerateRandomUTF8String(minLength int, maxLength int, withUncommon bool) (string, error)
- func GetHostAddress(ha host.Host) multiaddr.Multiaddr
- func MakeHost(ctx context.Context, port int, randomness io.Reader) (host.Host, error)
- func NewLocalnode(priv *ecdsa.PrivateKey, ipAddr *net.TCPAddr, udpPort int, ...) (*enode.LocalNode, error)
- func RandomBytes(n int) ([]byte, error)
- func RandomHex(n int) (string, error)
- func RandomInt(min, max int) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHost ¶ added in v0.9.0
func CreateWakuMessage ¶
func CreateWakuMessage(contentTopic string, timestamp *int64, optionalPayload ...string) *pb.WakuMessage
CreateWakuMessage creates a WakuMessage protobuffer with default values and a custom contenttopic and timestamp
func FindFreePort ¶
FindFreePort returns an available port number
func FindFreeUDPPort ¶ added in v0.4.0
FindFreePort returns an available port number
func GenerateRandomASCIIString ¶ added in v0.9.0
func GenerateRandomBase64String ¶ added in v0.9.0
func GenerateRandomJSONString ¶ added in v0.9.0
func GenerateRandomSQLInsert ¶ added in v0.9.0
func GenerateRandomURLEncodedString ¶ added in v0.9.0
func GenerateRandomUTF8String ¶ added in v0.9.0
func GetHostAddress ¶
GetHostAddress returns the first listen address used by a host
func NewLocalnode ¶ added in v0.9.0
func RandomBytes ¶ added in v0.9.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.