data

package
v0.0.0-...-6e6bb61 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliveriesQ

type DeliveriesQ interface {
	New() DeliveriesQ

	Get() (*Delivery, error)
	Select() ([]Delivery, error)
	Update() ([]Delivery, error)

	Transaction(fn func(q DeliveriesQ) error) error

	FilterByStatus(statuses ...types.DeliveryStatus) DeliveriesQ
	FilterByID(ids ...int64) DeliveriesQ

	JoinNotification() DeliveriesQ

	SetStatus(status types.DeliveryStatus) DeliveriesQ
}

type Delivery

type Delivery struct {
	ID              int64                 `db:"id"`
	NotificationID  int64                 `db:"notification_id"`
	Destination     string                `db:"destination"`
	DestinationType types.DestinationType `db:"destination_type"`
	Status          types.DeliveryStatus  `db:"status"`
	SentAt          time.Time             `db:"sent_at"`
}

type Message

type Message resources.Message

func (*Message) Scan

func (m *Message) Scan(src interface{}) error

func (Message) Value

func (m Message) Value() (driver.Value, error)

type Notification

type Notification struct {
	ID        int64     `db:"id"`
	CreatedAt time.Time `db:"created_at"`
	Topic     string    `db:"topic"`
	Channel   *string   `db:"channel"`
	Message   Message   `db:"message"`
}

type NotificationsQ

type NotificationsQ interface {
	New() NotificationsQ

	Get() (*Notification, error)
	Select() ([]Notification, error)

	Transaction(fn func(q NotificationsQ) error) error

	Insert(data Notification) (*Notification, error)
	InsertDeliveries(data []Delivery) ([]Delivery, error)

	FilterByID(id ...int64) NotificationsQ
}

type NotificatorService

type NotificatorService struct {
	Endpoint *url.URL
	Channels []string
}

type NotificatorsStorage

type NotificatorsStorage interface {
	Add(svc *NotificatorService) error
	GetByChannel(channel string) (*NotificatorService, error)
	Channels() ([]string, error)
}

type TemplateMessageAttributes

type TemplateMessageAttributes struct {
	Payload *json.RawMessage `json:"payload"`
	Locale  *string          `json:"locale"`
	Files   []string         `json:"files"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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