Documentation ¶
Index ¶
- func Caller() string
- func CheckConnection(network, ip string, port int, timeout time.Duration) bool
- func ExeDirJoin(elem ...string) string
- func IsHostname(s string) bool
- func IsIPv4(s string) bool
- func IsNetPort(str string) bool
- func IsTLSCert(block string) bool
- func IsUUID(s string) bool
- func NewUUID() string
- func ReadJSONFile(name string, data interface{}) error
- func ReadTestArgs(args *TestArgs)
- func RootPath() string
- func SingleTimeFormat(tm time.Time) string
- func TestExpectResult(t *testing.T, op string, expected, actual error)
- func TestUnmarshalJSON(t *testing.T, data []byte, v interface{})
- func ValidateJSON(schema, data []byte) bool
- func WriteJSONFile(name, prefix, indent string, data interface{}) error
- type TestArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Caller ¶
func Caller() string
Caller returns a caller's call location. If F1 calls F2 which in its turn calls Caller, then this function will return a location within F1 where it calls F2.
func CheckConnection ¶
CheckConnection connects to the specified host on the specified port. If the connection is successful then return true.
func ExeDirJoin ¶
ExeDirJoin composes a file name relative to a running executable.
func ReadJSONFile ¶
ReadJSONFile reads and parses a JSON file filling a given data instance.
func ReadTestArgs ¶
func ReadTestArgs(args *TestArgs)
ReadTestArgs parses command line and reads arguments.
func SingleTimeFormat ¶
SingleTimeFormat converts time to a string in a single format.
func TestExpectResult ¶
TestExpectResult compares two errors and fails a test if they don't match.
func TestUnmarshalJSON ¶
TestUnmarshalJSON unmarshals a given JSON into a given object.
func ValidateJSON ¶
ValidateJSON validates a given JSON against a given schema.
func WriteJSONFile ¶
WriteJSONFile converts a given data instance to JSON and writes it to file.