MCPcopy Create free account
hub / github.com/gotify/server / GetMessageByID

Method GetMessageByID

database/message.go:9–19  ·  view source on GitHub ↗

GetMessageByID returns the messages for the given id or nil.

(id uint)

Source from the content-addressed store, hash-verified

7
8// GetMessageByID returns the messages for the given id or nil.
9func (d *GormDatabase) GetMessageByID(id uint) (*model.Message, error) {
10 msg := new(model.Message)
11 err := d.DB.Find(msg, id).Error
12 if err == gorm.ErrRecordNotFound {
13 err = nil
14 }
15 if msg.ID == id {
16 return msg, err
17 }
18 return nil, err
19}
20
21// CreateMessage creates a message.
22func (d *GormDatabase) CreateMessage(message *model.Message) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected