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

Function HasDeployKey

internal/database/ssh_key.go:644–647  ·  view source on GitHub ↗

HasDeployKey returns true if public key is a deploy key of given repository.

(keyID, repoID int64)

Source from the content-addressed store, hash-verified

642
643// HasDeployKey returns true if public key is a deploy key of given repository.
644func HasDeployKey(keyID, repoID int64) bool {
645 has, _ := x.Where("key_id = ? AND repo_id = ?", keyID, repoID).Get(new(DeployKey))
646 return has
647}
648
649// AddDeployKey add new deploy key to database and authorized_keys file.
650func AddDeployKey(repoID int64, name, content string) (*DeployKey, error) {

Callers 1

checkDeployKeyFunction · 0.92

Calls 2

WhereMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected