Documentation
¶
Index ¶
- Constants
- Variables
- type TaskCommandID
- type TaskContext
- type TaskID
- type TaskInstanceID
- type TaskNotificationSender
- type TaskRunBy
- type TaskRunner
- type TaskService
- func (s *TaskService) Run(serviceStopCtx context.Context, serviceStopWaiter *sync.WaitGroup)
- func (s *TaskService) SetTaskNotificationSender(taskNotificiationSender TaskNotificationSender)
- func (s *TaskService) TaskCancel(taskInstanceID TaskInstanceID) (succeeded bool)
- func (s *TaskService) TaskRun(taskID TaskID, taskCommandID TaskCommandID, notifierID string, ...) (succeeded bool)
- func (s *TaskService) TaskRunWithContext(taskID TaskID, taskCommandID TaskCommandID, taskCtx TaskContext, ...) (succeeded bool)
Constants ¶
View Source
const ( TaskCtxKeyTitle = "Title" TaskCtxKeyErrorOccurred = "ErrorOccurred" TaskCtxKeyTaskID = "Task.TaskID" TaskCtxKeyTaskCommandID = "Task.TaskCommandID" TaskCtxKeyTaskInstanceID = "Task.TaskInstanceID" TaskCtxKeyElapsedTimeAfterRun = "Task.ElapsedTimeAfterRun" )
View Source
const ( // TaskID TidAlganicMall TaskID = "ALGANICMALL" // 엘가닉몰(http://www.alganicmall.com/) // TaskCommandID TcidAlganicMallWatchNewEvents TaskCommandID = "WatchNewEvents" // 엘가닉몰 신규 이벤트 확인 TcidAlganicMallWatchAtoCream TaskCommandID = "WatchAtoCream" // 엘가닉몰 아토크림 정보 변경 확인 )
View Source
const ( // TaskID TidCovid19 TaskID = "COVID19" // TaskCommandID TcidCovid19WatchResidualVaccine TaskCommandID = "WatchResidualVaccine" // 코로나19 잔여백신 확인 )
View Source
const ( // TaskID TidJdc TaskID = "JDC" // 전남디지털역량교육(http://전남디지털역량.com/) // TaskCommandID TcidJdcWatchNewOnlineEducation TaskCommandID = "WatchNewOnlineEducation" // 신규 비대면 온라인 특별/정규교육 확인 )
View Source
const ( // TaskID TidJyiu TaskID = "JYIU" // 전남여수산학융합원(https://www.jyiu.or.kr/) // TaskCommandID TcidJyiuWatchNewNotice TaskCommandID = "WatchNewNotice" // 전남여수산학융합원 공지사항 새글 확인 TcidJyiuWatchNewEducation TaskCommandID = "WatchNewEducation" // 전남여수산학융합원 신규 교육프로그램 확인 )
View Source
const ( // TaskID TidLotto TaskID = "LOTTO" // TaskCommandID TcidLottoPrediction TaskCommandID = "Prediction" // 로또 번호 예측 )
View Source
const ( TidNaver TaskID = "NAVER" // 네이버 TcidNaverWatchNewPerformances TaskCommandID = "WatchNewPerformances" // 네이버 신규 공연정보 확인 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type TaskCommandID ¶
type TaskCommandID string
type TaskContext ¶
type TaskContext interface {
With(key, val interface{}) TaskContext
WithTask(taskID TaskID, taskCommandID TaskCommandID) TaskContext
WithInstanceID(taskInstanceID TaskInstanceID, elapsedTimeAfterRun int64) TaskContext
WithError() TaskContext
Value(key interface{}) interface{}
}
TaskContext
func NewContext ¶
func NewContext() TaskContext
type TaskID ¶
type TaskID string
const ( TidNaverShopping TaskID = "NS" // 네이버쇼핑(https://shopping.naver.com/) TcidNaverShoppingWatchPriceAny = TaskCommandID(naverShoppingWatchPriceTaskCommandIDPrefix + taskCommandIDAnyString) // 네이버쇼핑 가격 확인 )
type TaskInstanceID ¶
type TaskInstanceID string
type TaskNotificationSender ¶
type TaskNotificationSender interface {
NotifyToDefault(message string) bool
NotifyWithTaskContext(notifierID string, message string, taskCtx TaskContext) bool
SupportHTMLMessage(notifierID string) bool
}
TaskNotificationSender
type TaskRunner ¶
type TaskRunner interface {
TaskRun(taskID TaskID, taskCommandID TaskCommandID, notifierID string, notifyResultOfTaskRunRequest bool, taskRunBy TaskRunBy) (succeeded bool)
TaskRunWithContext(taskID TaskID, taskCommandID TaskCommandID, taskCtx TaskContext, notifierID string, notifyResultOfTaskRunRequest bool, taskRunBy TaskRunBy) (succeeded bool)
TaskCancel(taskInstanceID TaskInstanceID) (succeeded bool)
}
TaskRunner
type TaskService ¶
type TaskService struct {
// contains filtered or unexported fields
}
TaskService
func NewService ¶
func NewService(config *g.AppConfig) *TaskService
func (*TaskService) Run ¶
func (s *TaskService) Run(serviceStopCtx context.Context, serviceStopWaiter *sync.WaitGroup)
func (*TaskService) SetTaskNotificationSender ¶
func (s *TaskService) SetTaskNotificationSender(taskNotificiationSender TaskNotificationSender)
func (*TaskService) TaskCancel ¶
func (s *TaskService) TaskCancel(taskInstanceID TaskInstanceID) (succeeded bool)
func (*TaskService) TaskRun ¶
func (s *TaskService) TaskRun(taskID TaskID, taskCommandID TaskCommandID, notifierID string, notifyResultOfTaskRunRequest bool, taskRunBy TaskRunBy) (succeeded bool)
func (*TaskService) TaskRunWithContext ¶
func (s *TaskService) TaskRunWithContext(taskID TaskID, taskCommandID TaskCommandID, taskCtx TaskContext, notifierID string, notifyResultOfTaskRunRequest bool, taskRunBy TaskRunBy) (succeeded bool)
Click to show internal directories.
Click to hide internal directories.