events

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskRetriedExtension     = "taskretried"
	TaskMaxRetriesExtension  = "taskmaxretries"
	TaskQueueExtension       = "taskqueue"
	TaskNotBeforeExtension   = "tasknotbefore"
	ScheduledTaskExtension   = "scheduledtask"
	ScheduleIdExtension      = "scheduleid"
	QstashMessageIdExtension = "qstashmessageid"
)

Task extension keys

View Source
const ApplicationJson = "application/json"
View Source
const Source = "fxfeed"

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(ce cloudevents.Event, target interface{}) error

func GetBoolExtension added in v0.1.0

func GetBoolExtension(event *cloudevents.Event, key string) (bool, bool)

GetBoolExtension safely retrieves a bool extension

func GetIntExtension added in v0.1.0

func GetIntExtension(event *cloudevents.Event, key string) (int, bool)

GetIntExtension safely retrieves an int extension

func GetMaxRetries added in v0.1.0

func GetMaxRetries(event *cloudevents.Event) (int, bool)

GetMaxRetries returns the maximum number of retries for this task

func GetNotBefore added in v0.1.0

func GetNotBefore(event *cloudevents.Event) (time.Time, bool)

GetNotBefore returns the time before which this task should not be processed

func GetQstashMessageID added in v0.1.0

func GetQstashMessageID(event *cloudevents.Event) string

GetQstashMessageID returns the Qstash message ID for this task

func GetQueue added in v0.1.0

func GetQueue(event *cloudevents.Event) string

GetQueue returns the queue this task is in

func GetRetried added in v0.1.0

func GetRetried(event *cloudevents.Event) (int, bool)

GetRetried returns the number of times this task has been retried

func GetScheduleID added in v0.1.0

func GetScheduleID(event *cloudevents.Event) string

GetScheduleID returns the schedule ID for this task

func GetStringExtension added in v0.1.0

func GetStringExtension(event *cloudevents.Event, key string) (string, bool)

GetStringExtension safely retrieves a string extension

func GetTimeExtension added in v0.1.0

func GetTimeExtension(event *cloudevents.Event, key string) (time.Time, bool)

GetTimeExtension safely retrieves a time.Time extension

func IsScheduled added in v0.1.0

func IsScheduled(event *cloudevents.Event) bool

IsScheduled returns true if the event was scheduled

func Serialize

func Serialize(ctx context.Context, args Kinder) (cloudevents.Event, error)

func SerializeWithExt

func SerializeWithExt(ctx context.Context, args Kinder, extKvPairs ...string) (cloudevents.Event, error)

func SetMaxRetries added in v0.1.0

func SetMaxRetries(event *cloudevents.Event, maxRetries int)

SetMaxRetries sets the maximum number of retries for this task

func SetNotBefore added in v0.1.0

func SetNotBefore(event *cloudevents.Event, notBefore time.Time)

SetNotBefore sets the time before which this task should not be processed

func SetQstashMessageID added in v0.1.0

func SetQstashMessageID(event *cloudevents.Event, messageID string)

SetQstashMessageID sets the Qstash message ID for this task

func SetQueue added in v0.1.0

func SetQueue(event *cloudevents.Event, queue string)

SetQueue sets the queue for this task

func SetRetried added in v0.1.0

func SetRetried(event *cloudevents.Event, retried int)

SetRetried sets the number of times this task has been retried

func SetScheduleID added in v0.1.0

func SetScheduleID(event *cloudevents.Event, scheduleID string)

SetScheduleID sets the schedule ID for this task

func SetScheduled added in v0.1.0

func SetScheduled(event *cloudevents.Event, scheduled bool)

SetScheduled sets whether this task was scheduled

Types

type Kinder

type Kinder interface {
	Kind() string
}

type Payloader

type Payloader interface {
	Payload() any
}

Jump to

Keyboard shortcuts

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