Versions in this module Expand all Collapse all v1 v1.0.1 Jul 17, 2019 Changes in this version type Settings + AWSDebugRequestLogEnabled bool v1.0.0 Jan 14, 2019 Changes in this version + const ErrStringTaskNotFound + var ErrRetry = errors.New("Retry exception") + func InitSettings(settings *Settings) + func NewLambdaHandler(consumer ILambdaConsumer) lambda.Handler + type AWSSessionsCache struct + func NewAWSSessionsCache() *AWSSessionsCache + func (c *AWSSessionsCache) GetSession(ctx context.Context) *session.Session + type DefaultHeaders func(ctx context.Context, task ITask) map[string]string + type ILambdaConsumer interface + HandleLambdaEvent func(ctx context.Context, snsEvent *events.SNSEvent) error + type IPublisher interface + Publish func(ctx context.Context, message *message) error + Settings func() *Settings + func NewPublisher(sessionCache *AWSSessionsCache, settings *Settings) IPublisher + type IQueueConsumer interface + ListenForMessages func(ctx context.Context, request *ListenRequest) error + type ITask interface + Name func() string + NewInput func() interface{} + Priority func() Priority + Run func(context context.Context, input interface{}) error + type ITaskHeaders interface + GetHeaders func() map[string]string + SetHeaders func(map[string]string) + type ITaskMetadata interface + SetID func(string) + SetPriority func(Priority) + SetReceipt func(string) + SetTimestamp func(JSONTime) + SetVersion func(Version) + type ITaskRegistry interface + Dispatch func(taskName string, input interface{}) error + DispatchWithContext func(ctx context.Context, taskName string, input interface{}) error + DispatchWithPriority func(ctx context.Context, taskName string, priority Priority, input interface{}) error + GetTask func(name string) (ITask, error) + NewLambdaConsumer func(sessionCache *AWSSessionsCache, settings *Settings) ILambdaConsumer + NewQueueConsumer func(sessionCache *AWSSessionsCache, settings *Settings) IQueueConsumer + RegisterTask func(task ITask) error + type JSONTime time.Time + func (t *JSONTime) UnmarshalJSON(b []byte) error + func (t JSONTime) MarshalJSON() ([]byte, error) + type LambdaHandler struct + func (handler *LambdaHandler) Invoke(ctx context.Context, payload []byte) ([]byte, error) + type LambdaRequest struct + Ctx context.Context + Priority Priority + Record *events.SNSEventRecord + TaskRegistry ITaskRegistry + type ListenRequest struct + LoopCount uint + NumMessages uint + Priority Priority + VisibilityTimeoutS uint + type PreProcessHookLambdaApp func(request *LambdaRequest) error + type PreProcessHookQueueApp func(request *QueueRequest) error + type Priority int + const PriorityBulk + const PriorityDefault + const PriorityHigh + const PriorityLow + func (p *Priority) UnmarshalJSON(b []byte) error + func (p Priority) MarshalJSON() ([]byte, error) + type QueueRequest struct + Ctx context.Context + Priority Priority + QueueMessage *sqs.Message + QueueName string + QueueURL string + TaskRegistry ITaskRegistry + type Settings struct + AWSAccessKey string + AWSAccountID string + AWSReadTimeout time.Duration + AWSRegion string + AWSSecretKey string + AWSSessionToken string + DefaultHeaders DefaultHeaders + IsLambdaApp bool + PreProcessHookLambdaApp PreProcessHookLambdaApp + PreProcessHookQueueApp PreProcessHookQueueApp + Queue string + ShutdownTimeout time.Duration + Sync bool + type Task struct + DefaultPriority Priority + Inputer inputer + TaskName string + func (t *Task) Name() string + func (t *Task) NewInput() interface{} + func (t *Task) Priority() Priority + type TaskHeaders struct + Headers map[string]string + func (h *TaskHeaders) GetHeaders() map[string]string + func (h *TaskHeaders) SetHeaders(headers map[string]string) + type TaskMetadata struct + ID string + Priority Priority + Receipt string + Timestamp JSONTime + Version Version + func (m *TaskMetadata) SetID(id string) + func (m *TaskMetadata) SetPriority(priority Priority) + func (m *TaskMetadata) SetReceipt(receipt string) + func (m *TaskMetadata) SetTimestamp(time JSONTime) + func (m *TaskMetadata) SetVersion(version Version) + type TaskRegistry struct + func NewTaskRegistry(publisher IPublisher) (*TaskRegistry, error) + func (tr *TaskRegistry) Dispatch(taskName string, input interface{}) error + func (tr *TaskRegistry) DispatchWithContext(ctx context.Context, taskName string, input interface{}) error + func (tr *TaskRegistry) DispatchWithPriority(ctx context.Context, taskName string, priority Priority, input interface{}) error + func (tr *TaskRegistry) GetTask(name string) (ITask, error) + func (tr *TaskRegistry) NewLambdaConsumer(sessionCache *AWSSessionsCache, settings *Settings) ILambdaConsumer + func (tr *TaskRegistry) NewQueueConsumer(sessionCache *AWSSessionsCache, settings *Settings) IQueueConsumer + func (tr *TaskRegistry) RegisterTask(task ITask) error + type Version string + const CurrentVersion + const Version1_0