trigger

package
v2.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQPTrigger

type AMQPTrigger struct {
	// contains filtered or unexported fields
}

func NewAMQPTrigger

func NewAMQPTrigger(rabbitURL string, routingKey string, numWorkers int) *AMQPTrigger

NewSQSTrigger attaches to a SQS queue and executes Func for every message. If Func returns error != nil, message is not deleted after processing.

func (*AMQPTrigger) RunFunc

func (t *AMQPTrigger) RunFunc(f RunFunc)

func (*AMQPTrigger) Start

func (t *AMQPTrigger) Start()

func (*AMQPTrigger) Stop

func (t *AMQPTrigger) Stop()

type HTTPTrigger

type HTTPTrigger struct {
	// contains filtered or unexported fields
}

func NewHTTPTrigger

func NewHTTPTrigger(endpoint string, responseMimeType string) *HTTPTrigger

NewHTTPTrigger registers an endpoint to call Fn If Rn returns err, Trigger will respond with HTTP 400 Bad Request Trigger will send Fn return string as response

func (*HTTPTrigger) RunFunc

func (t *HTTPTrigger) RunFunc(f RunFunc)

func (*HTTPTrigger) Start

func (t *HTTPTrigger) Start()

func (*HTTPTrigger) Stop

func (t *HTTPTrigger) Stop()

type RunFunc

type RunFunc func(*string) (*string, error)

type SQSTrigger

type SQSTrigger struct {
	// contains filtered or unexported fields
}

func NewSQSTrigger

func NewSQSTrigger(sqsClient *sqs.SQS, sqsURL string, sqsBatchSize int64) *SQSTrigger

NewSQSTrigger attaches to a SQS queue and executes Func for every message. If Func returns error != nil, message is not deleted after processing.

func (*SQSTrigger) RunFunc

func (t *SQSTrigger) RunFunc(f RunFunc)

func (*SQSTrigger) Start

func (t *SQSTrigger) Start()

func (*SQSTrigger) Stop

func (t *SQSTrigger) Stop()

type TimerTrigger

type TimerTrigger struct {
	// contains filtered or unexported fields
}

func NewTimerTrigger

func NewTimerTrigger(cronStr string) *TimerTrigger

NewTimerTrigger registers a new function to be executed at the specified time interface cron is a crontab style string, refer to https://godoc.org/github.com/robfig/cron

func (*TimerTrigger) RunFunc

func (t *TimerTrigger) RunFunc(f RunFunc)

func (*TimerTrigger) Start

func (t *TimerTrigger) Start()

func (*TimerTrigger) Stop

func (t *TimerTrigger) Stop()

type Trigger

type Trigger interface {
	RunFunc(RunFunc)
	Start()
	Stop()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL