notifications

package
v0.0.70 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	Queue          Publisher
	ID             string
	Topic          string
	Level          scumflashes.FlashLevel
	Template       string
	Vars           NotificationVars
	Target         string
	OrganisationID string
	UserID         string
	UserEmail      string
	Emailed        bool
	EmailedAt      time.Time
	Seen           bool
	SeenAt         time.Time
	CreatedAt      time.Time
	UpdatedAt      time.Time
	Revision       string
}

func (Notification) Ago

func (this Notification) Ago() string

func (Notification) Delete

func (this Notification) Delete(ctx context.Context) error

func (*Notification) FindByColumn

func (this *Notification) FindByColumn(ctx context.Context, col, val string) error

func (*Notification) FindByID

func (this *Notification) FindByID(ctx context.Context, id string) error

func (Notification) Label

func (this Notification) Label() string

func (*Notification) New

func (this *Notification) New(level scumflashes.FlashLevel, topic, organisationID, userID string)

func (*Notification) Publish

func (this *Notification) Publish(ctx context.Context) error

func (*Notification) Save

func (this *Notification) Save(ctx context.Context) error

type NotificationStatus

type NotificationStatus struct {
	NoUnread    bool
	Num         int
	NumWarnings int
	NumSuccess  int
	NumInfo     int
	AnyWarnings bool
	AnySuccess  bool
	AnyInfo     bool
}

func NotificationStatusForUser

func NotificationStatusForUser(ctx context.Context, userID string) (NotificationStatus, error)

type NotificationVars

type NotificationVars []any

func (*NotificationVars) Scan

func (this *NotificationVars) Scan(value interface{}) error

func (NotificationVars) Value

func (this NotificationVars) Value() (driver.Value, error)

type Notifications

type Notifications struct {
	Data     []Notification
	Criteria scummodel.Criteria
}

func (Notifications) AvailableFilters

func (Notifications) AvailableFilters() scumfilter.Filters

func (Notifications) ByID

func (this Notifications) ByID() map[string]Notification

func (Notifications) ByTopic

func (this Notifications) ByTopic() map[string]Notifications

func (Notifications) EmailCopy

func (this Notifications) EmailCopy(uri string) marcel.Email

func (*Notifications) FindAll

func (this *Notifications) FindAll(ctx context.Context, criteria scummodel.Criteria) error

func (Notifications) ForTopic

func (this Notifications) ForTopic(in string) Notifications

func (*Notifications) MarkEmailed

func (this *Notifications) MarkEmailed(ctx context.Context) error

func (Notifications) Searchable

func (Notifications) Searchable() scumsearch.Searchable

func (Notifications) Seen

func (this Notifications) Seen() Notifications

func (Notifications) Unseen

func (this Notifications) Unseen() Notifications

func (*Notifications) UnseenAndNotEmailedForUser

func (this *Notifications) UnseenAndNotEmailedForUser(ctx context.Context, userID string) error

type Publisher

type Publisher interface {
	Publish(context.Context, *kewpie.Task) error
}

Jump to

Keyboard shortcuts

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