GetClientByID returns the client for the given id or nil.
(id uint)
| 9 | |
| 10 | // GetClientByID returns the client for the given id or nil. |
| 11 | func (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. |
| 24 | func (d *GormDatabase) GetClientByToken(token string) (*model.Client, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected