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

Function GetDeployKeyByRepo

internal/database/ssh_key.go:718–730  ·  view source on GitHub ↗

GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.

(keyID, repoID int64)

Source from the content-addressed store, hash-verified

716
717// GetDeployKeyByRepo returns deploy key by given public key ID and repository ID.
718func GetDeployKeyByRepo(keyID, repoID int64) (*DeployKey, error) {
719 key := &DeployKey{
720 KeyID: keyID,
721 RepoID: repoID,
722 }
723 has, err := x.Get(key)
724 if err != nil {
725 return nil, err
726 } else if !has {
727 return nil, ErrDeployKeyNotExist{args: map[string]any{"keyID": keyID, "repoID": repoID}}
728 }
729 return key, nil
730}
731
732// UpdateDeployKey updates deploy key information.
733func UpdateDeployKey(key *DeployKey) error {

Callers 1

checkDeployKeyFunction · 0.92

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected