model

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: MIT Imports: 3 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 {
	Title   string
	Body    string
	State   NotificationState
	Hidden  bool
	Servity NotificationServity
}

type NotificationAggregate

type NotificationAggregate struct {
	eventsourcing.AggregateRoot
	Notification
}

func CreateNotification

func CreateNotification(
	title string,
	body string,
	servity NotificationServity,
	metadata map[string][]string,
) (*NotificationAggregate, error)

func (*NotificationAggregate) Register

func (*NotificationAggregate) Transition

func (n *NotificationAggregate) Transition(event eventsourcing.Event)

type NotificationCreated

type NotificationCreated struct {
	Title    string
	Body     string
	Servity  NotificationServity
	Metadata map[string][]string
}

Events

type NotificationHidden

type NotificationHidden struct {
}

type NotificationRead

type NotificationRead struct {
}

type NotificationServity

type NotificationServity int
const (
	NotificationServityInfo NotificationServity = iota
	NotificationServityWarning
	NotificationServityError
)

func NotificationServityFromString

func NotificationServityFromString(s string) (NotificationServity, error)

func (NotificationServity) MarshalJSON

func (s NotificationServity) MarshalJSON() ([]byte, error)

func (NotificationServity) String

func (s NotificationServity) String() string

func (*NotificationServity) UnmarshalJSON

func (s *NotificationServity) UnmarshalJSON(data []byte) error

type NotificationState

type NotificationState int
const (
	Unread NotificationState = iota
	Read
)

Jump to

Keyboard shortcuts

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