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

Method GetApplicationByToken

database/application.go:13–23  ·  view source on GitHub ↗

GetApplicationByToken returns the application for the given token or nil.

(token string)

Source from the content-addressed store, hash-verified

11
12// GetApplicationByToken returns the application for the given token or nil.
13func (d *GormDatabase) GetApplicationByToken(token string) (*model.Application, error) {
14 app := new(model.Application)
15 err := d.DB.Where("token = ?", token).Find(app).Error
16 if err == gorm.ErrRecordNotFound {
17 err = nil
18 }
19 if app.Token == token {
20 return app, err
21 }
22 return nil, err
23}
24
25// GetApplicationByID returns the application for the given id or nil.
26func (d *GormDatabase) GetApplicationByID(id uint) (*model.Application, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected