MCPcopy Create free account
hub / github.com/gogs/gogs / GetDeployKeyByID

Function GetDeployKeyByID

internal/database/ssh_key.go:706–715  ·  view source on GitHub ↗

GetDeployKeyByID returns deploy key by given ID.

(id int64)

Source from the content-addressed store, hash-verified

704
705// GetDeployKeyByID returns deploy key by given ID.
706func GetDeployKeyByID(id int64) (*DeployKey, error) {
707 key := new(DeployKey)
708 has, err := x.Id(id).Get(key)
709 if err != nil {
710 return nil, err
711 } else if !has {
712 return nil, ErrDeployKeyNotExist{args: map[string]any{"deployKeyID": id}}
713 }
714 return key, nil
715}
716
717// GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.
718func GetDeployKeyByRepo(keyID, repoID int64) (*DeployKey, error) {

Callers 3

GetDeployKeyFunction · 0.92
DeleteDeploykeyFunction · 0.92
DeleteDeployKeyFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected