Documentation
¶
Index ¶
- func DecodeJSON(data io.Reader, out interface{}) error
- func DeleteEmpty(s []string) []string
- func Filter(vs []string, f func(string) bool) []string
- func FormatTime(t time.Time) string
- func GetAvailablePort() int
- func GetExternalIP() (string, error)
- func GetListenAddress(addr string) string
- func GetLocalIP() (ip string)
- func ID() string
- func Include(vs []string, t string) bool
- func Index(vs []string, t string) int
- func IndexUint(vs []uint, t uint) int
- func Map(vs []string, f func(string) string) []string
- func ParseTime(str string) time.Time
- func RandomString() string
- func TimeNow() *time.Time
- func UnmarshalJSON(data []byte, out interface{}) error
- func WaitTCP(duration time.Duration, host string, port int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSON ¶
DecodeJSON is a convenience function to create a JSON decoder set it up to disallow unknown fields and then decode into the given value.
func DeleteEmpty ¶
DeleteEmpty returns a new slice containing all non-empty strings in the original slice.
func Filter ¶
Filter returns a new slice containing all strings in the slice that satisfy the predicate f.
func FormatTime ¶
FormatTime returns DB compatible datetime string.
func GetListenAddress ¶
GetListenAddress gets local or external listen address.
func IndexUint ¶
IndexUint returns the first index of the target uint t, or -1 if not match is found.
func Map ¶
Map returns a new slice containing the results of applying the function f to each string in the original slice.
func UnmarshalJSON ¶
UnmarshalJSON is a convenience function around calling DecodeJSON.
Types ¶
This section is empty.