Versions in this module Expand all Collapse all v1 v1.0.0 Apr 12, 2019 Changes in this version + var ErrAlreadyStarted = errors.New("already started") + var ErrAlreadyStopped = errors.New("already stopped") + var ErrNotStarted = errors.New("not started") + var TimeLayout = "2006-01-02" + func ChWorkDir() + func ConvertToUnixPathSeparator(p string) string + func Executable() string + func ExecutablePath() string + func ExecutablePathJoin(subPath string) string + func ExecuteFuncWithTimeout(f func(), t time.Duration) + func FileExist(filePath string) bool + func GetCurPcIp(matcher string) string + func GetUniqueId() string + func HomeDir() string + func InterfaceIsNil(i interface{}) bool + func InterfaceSliceCopy(to, from interface{}) + func IsIPhoneOS() bool + func IsTestEnv() bool + func ParseDateRange(dateRange string) (startDate, endDate time.Time, err error) + func ParseJson(data string, result interface{}) error + func ParseJsonFromBytes(data []byte, result interface{}) error + func PathExists(path string) bool + func SetTimeout(timeoutFunc func(), dur time.Duration) (finishFunc func()) + func StopChanClosed(stop chan struct{}) bool + func StringifyJson(data interface{}) string + func StringifyJsonToBytes(data interface{}) []byte + func StringifyJsonToBytesWithErr(data interface{}) ([]byte, error) + func WalkDir(dirPth, suffix string) (files []string, err error) + func WriteDebugStack(toFile string) error + type BaseService struct + Logger log.Logger + func NewBaseService(logger log.Logger, name string, impl Service) *BaseService + func (bs *BaseService) IsRunning() bool + func (bs *BaseService) OnReset() error + func (bs *BaseService) OnStart() error + func (bs *BaseService) OnStop() + func (bs *BaseService) Quit() <-chan struct{} + func (bs *BaseService) Reset() error + func (bs *BaseService) SetLogger(l log.Logger) + func (bs *BaseService) Start() error + func (bs *BaseService) Stop() + func (bs *BaseService) String() string + func (bs *BaseService) Wait() + type Service interface + IsRunning func() bool + OnReset func() error + OnStart func() error + OnStop func() + Quit func() <-chan struct{} + Reset func() error + SetLogger func(logger log.Logger) + Start func() error + Stop func() + String func() string