scheduledevent

package
v0.0.0-...-d41ed40 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Payload

type Payload interface {
	IsScheduledEventPayload()
	Type() Type
}

type ScheduledEvent

type ScheduledEvent struct {
	ID        uuid.UUID
	Status    Status
	Datetime  time.Time
	Payload   Payload
	CreatedAt time.Time
	Attempt   int64
}

func New

func New(datetime time.Time, eventType string, payload []byte) (ScheduledEvent, error)

New scheduledEvent constructor

type SendNotificationPayload

type SendNotificationPayload struct {
	To   string `json:"to"`
	Text string `json:"text"`
}

func (SendNotificationPayload) IsScheduledEventPayload

func (s SendNotificationPayload) IsScheduledEventPayload()

func (SendNotificationPayload) Type

func (s SendNotificationPayload) Type() Type

type Status

type Status uint8
const (
	EventStatusNew Status = iota
	EventStatusInProgress
	EventStatusDone
	EventStatusFailed
)

type Type

type Type string
const (
	SendNotification Type = "SEND_NOTIFICATION" // whatever
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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