Documentation
¶
Index ¶
- func Dir(path string) error
- func ErrorForExit(name string, err error, code ...int)
- func HostAndPort(hostAndPort string) bool
- func Int32SliceContains(slice []int32, target int32) bool
- func Int64SliceContains(slice []int64, target int64) bool
- func IntSliceContains(slice []int, target int) bool
- func StringSliceContains(slice []string, target string) bool
- type ReadableError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dir ¶
Dir checks the given path, will return error if path not exists or path is not directory.
func ErrorForExit ¶
ErrorForExit check the error. If error is not nil, print the error message and exit the application. If error is nil, do nothing.
func HostAndPort ¶
HostAndPort checks whether a string contains host and port. It returns true if matched.
func Int32SliceContains ¶
Int32SliceContains iterates over the slice to find the target.
func Int64SliceContains ¶
Int64SliceContains iterates over the slice to find the target.
func IntSliceContains ¶
IntSliceContains iterates over the slice to find the target.
func StringSliceContains ¶
StringSliceContains iterates over the slice to find the target.
Types ¶
type ReadableError ¶
type ReadableError struct {
Message string
}
ReadableError is just a structure contains readable message that can be returned directly to end user.
func NewReadableError ¶
func NewReadableError(message string) ReadableError
NewReadableError creates a ReadableError{} from given message.
func (ReadableError) Error ¶
func (e ReadableError) Error() string
Error returns the description of ReadableError.