messages

package
v0.0.0-...-39e0c7e Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Samples

func Samples() error

func SetDB

func SetDB(database database.Database)

Types

type Message

type Message struct {
	Id                int64          `gorm:"primary_key;column:id" json:"id"`
	Title             string         `gorm:"column:title" json:"title"`
	Description       string         `gorm:"column:description" json:"description"`
	StartOn           time.Time      `gorm:"column:start_on" json:"start_on"`
	EndOn             time.Time      `gorm:"column:end_on" json:"end_on"`
	ServiceId         int64          `gorm:"index;column:service" json:"service"`
	NotifyUsers       null.NullBool  `gorm:"column:notify_users" json:"notify_users" scope:"user,admin"`
	NotifyMethod      string         `gorm:"column:notify_method" json:"notify_method" scope:"user,admin"`
	NotifyBefore      null.NullInt64 `gorm:"column:notify_before" json:"notify_before" scope:"user,admin"`
	NotifyBeforeScale string         `gorm:"column:notify_before_scale" json:"notify_before_scale" scope:"user,admin"`
	CreatedAt         time.Time      `gorm:"column:created_at" json:"created_at" json:"created_at"`
	UpdatedAt         time.Time      `gorm:"column:updated_at" json:"updated_at" json:"updated_at"`
}

Message is for creating Announcements, Alerts and other messages for the end users

func All

func All() []*Message

func Find

func Find(id int64) (*Message, error)

func (*Message) AfterCreate

func (m *Message) AfterCreate()

func (*Message) AfterDelete

func (m *Message) AfterDelete()

func (*Message) AfterFind

func (m *Message) AfterFind()

func (*Message) AfterUpdate

func (m *Message) AfterUpdate()

func (*Message) BeforeCreate

func (m *Message) BeforeCreate() error

func (*Message) BeforeUpdate

func (m *Message) BeforeUpdate() error

func (*Message) Create

func (m *Message) Create() error

func (*Message) Delete

func (m *Message) Delete() error

func (*Message) Update

func (m *Message) Update() error

func (*Message) Validate

func (m *Message) Validate() error

Jump to

Keyboard shortcuts

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