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

Method GetClientByID

database/client.go:11–21  ·  view source on GitHub ↗

GetClientByID returns the client for the given id or nil.

(id uint)

Source from the content-addressed store, hash-verified

9
10// GetClientByID returns the client for the given id or nil.
11func (d *GormDatabase) GetClientByID(id uint) (*model.Client, error) {
12 client := new(model.Client)
13 err := d.DB.Where("id = ?", id).Find(client).Error
14 if err == gorm.ErrRecordNotFound {
15 err = nil
16 }
17 if client.ID == id {
18 return client, err
19 }
20 return nil, err
21}
22
23// GetClientByToken returns the client for the given token or nil.
24func (d *GormDatabase) GetClientByToken(token string) (*model.Client, error) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected