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

Method GetClientByToken

database/client.go:24–34  ·  view source on GitHub ↗

GetClientByToken returns the client for the given token or nil.

(token string)

Source from the content-addressed store, hash-verified

22
23// GetClientByToken returns the client for the given token or nil.
24func (d *GormDatabase) GetClientByToken(token string) (*model.Client, error) {
25 client := new(model.Client)
26 err := d.DB.Where("token = ?", token).Find(client).Error
27 if err == gorm.ErrRecordNotFound {
28 err = nil
29 }
30 if client.Token == token {
31 return client, err
32 }
33 return nil, err
34}
35
36// CreateClient creates a client.
37func (d *GormDatabase) CreateClient(client *model.Client) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected