Documentation ¶ Index ¶ Variables func Start(ctx context.Context, services ...Service) error func Stop(ctx context.Context, services ...Service) error type RunFunc type Service func NewService(run RunFunc) Service Constants ¶ This section is empty. Variables ¶ View Source var ( ErrWorkerStopped = errors.New("worker stopped") ErrWorkerTimeout = errors.New("worker failed to shutdown before timeout") ) Functions ¶ func Start ¶ func Start(ctx context.Context, services ...Service) error func Stop ¶ func Stop(ctx context.Context, services ...Service) error Types ¶ type RunFunc ¶ type RunFunc func(context.Context) error type Service ¶ type Service interface { // Start launches the routine's Run method on a new goroutine. Start(context.Context) error // Stop cancels the previously started goroutine. Stop(context.Context) error } func NewService ¶ func NewService(run RunFunc) Service Source Files ¶ View all Source files service.go Click to show internal directories. Click to hide internal directories.