task

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MPL-2.0 Imports: 30 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDeliveryAttemptFailed = errors.New("error sending event")
View Source
var ErrGroupIdFieldIsNotString = errors.New("group_id field does not exist on the document")
View Source
var ErrGroupIdFieldIsRequired = errors.New("group_id field should be a string")
View Source
var ErrInvalidEmailPayload = errors.New("invalid email payload")
View Source
var ErrInvalidNotificationPayload = errors.New("invalid notification payload")
View Source
var ErrInvalidNotificationType = errors.New("invalid notification type")
View Source
var ErrInvalidSlackPayload = errors.New("invalid slack payload")
View Source
var ErrRateLimit = errors.New("rate limit error")

Functions

func ExportCollection added in v0.6.0

func ExportCollection(ctx context.Context, collection string, uri string, exportDir string, expDate time.Time, objectStoreClient objectstore.ObjectStore, group *datastore.Group, eventRepo datastore.EventRepository, eventDeliveriesRepo datastore.EventDeliveryRepository, groupRepo datastore.GroupRepository, searcher searcher.Searcher) error

func GetArgsByCollection added in v0.6.0

func GetArgsByCollection(collection string, uri string, exportDir string, expDate time.Time, group *datastore.Group) ([]string, string, error)

func GetRetryDelay added in v0.6.0

func GetRetryDelay(n int, err error, t *asynq.Task) time.Duration

func MonitorTwitterSources added in v0.6.0

func MonitorTwitterSources(store datastore.Store, queue queue.Queuer) func(context.Context, *asynq.Task) error

func NewObjectStoreClient added in v0.6.0

func NewObjectStoreClient(config *datastore.Configuration) (objectstore.ObjectStore, string, error)

func ProcessDeadLetters

func ProcessDeadLetters(job *queue.Job)

func ProcessEmails added in v0.6.5

func ProcessEmails(sc smtp.SmtpClient) func(context.Context, *asynq.Task) error

func ProcessEventCreation added in v0.6.5

func ProcessEventCreation(appRepo datastore.ApplicationRepository, eventRepo datastore.EventRepository, groupRepo datastore.GroupRepository, eventDeliveryRepo datastore.EventDeliveryRepository, cache cache.Cache, eventQueue queue.Queuer, subRepo datastore.SubscriptionRepository, search searcher.Searcher, deviceRepo datastore.DeviceRepository) func(context.Context, *asynq.Task) error

func ProcessEventDelivery

func ProcessEventDelivery(appRepo datastore.ApplicationRepository, eventDeliveryRepo datastore.EventDeliveryRepository, groupRepo datastore.GroupRepository, rateLimiter limiter.RateLimiter, subRepo datastore.SubscriptionRepository, notificationQueue queue.Queuer) func(context.Context, *asynq.Task) error

func ProcessNotifications added in v0.6.5

func ProcessNotifications(sc smtp.SmtpClient) func(context.Context, *asynq.Task) error

func RententionPolicies added in v0.6.0

func RententionPolicies(instanceConfig config.Configuration, configRepo datastore.ConfigurationRepository, groupRepo datastore.GroupRepository, eventRepo datastore.EventRepository, eventDeliveriesRepo datastore.EventDeliveryRepository, searcher searcher.Searcher) func(context.Context, *asynq.Task) error

func RetryEventDeliveries added in v0.6.0

func RetryEventDeliveries(statuses []datastore.EventDeliveryStatus, lookBackDuration string, store datastore.Store, eventQueue queue.Queuer)

func SearchIndex added in v0.6.5

func SearchIndex(search searcher.Searcher) func(ctx context.Context, t *asynq.Task) error

Types

type EndpointError

type EndpointError struct {
	Err error
	// contains filtered or unexported fields
}

func (*EndpointError) Delay

func (e *EndpointError) Delay() time.Duration

func (*EndpointError) Error

func (e *EndpointError) Error() string

type EventDeliveryConfig added in v0.7.0

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

type RateLimitConfig added in v0.7.0

type RateLimitConfig struct {
	Count    int
	Duration uint64
}

type RateLimitError added in v0.6.0

type RateLimitError struct {
	Err error
	// contains filtered or unexported fields
}

func (*RateLimitError) Delay added in v0.6.0

func (e *RateLimitError) Delay() time.Duration

func (*RateLimitError) Error added in v0.6.0

func (e *RateLimitError) Error() string

func (*RateLimitError) RateLimit added in v0.6.0

func (e *RateLimitError) RateLimit()

type RetryConfig added in v0.7.0

type RetryConfig struct {
	Type       datastore.StrategyProvider
	Duration   uint64
	RetryCount uint64
}

type SignatureValues added in v0.5.3

type SignatureValues struct {
	HMAC      string
	Timestamp string
}

Jump to

Keyboard shortcuts

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