yestday.go 570 B

1234567891011121314151617181920212223242526
  1. package browser
  2. import (
  3. "context"
  4. )
  5. type (
  6. //执行单元
  7. Worker struct {
  8. baseCancel, incCancel context.CancelFunc
  9. ctx context.Context
  10. js string
  11. contentDelay int64
  12. }
  13. )
  14. // NewWorker
  15. func NewWorker(headless bool, showImage bool, proxyServe string, contentDelay int64, js string) *Worker {
  16. _, baseCancel, _, _, ctx, cancel := NewBrowser(headless, showImage, proxyServe)
  17. return &Worker{baseCancel: baseCancel,
  18. incCancel: cancel,
  19. ctx: ctx,
  20. js: js,
  21. contentDelay: contentDelay,
  22. }
  23. }