mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-20 03:11:35 +02:00
fixup: add option to get FederationHost by KeyID
This commit is contained in:
parent
b29449c9c6
commit
c4fee697bc
1 changed files with 3 additions and 3 deletions
|
@ -30,7 +30,7 @@ func GetFederationHost(ctx context.Context, ID int64) (*FederationHost, error) {
|
|||
return host, nil
|
||||
}
|
||||
|
||||
func FindFederationHostFromDB(ctx context.Context, searchKey, searchValue string) (*FederationHost, error) {
|
||||
func findFederationHostFromDB(ctx context.Context, searchKey, searchValue string) (*FederationHost, error) {
|
||||
host := new(FederationHost)
|
||||
has, err := db.GetEngine(ctx).Where(searchKey, searchValue).Get(host)
|
||||
if err != nil {
|
||||
|
@ -45,11 +45,11 @@ func FindFederationHostFromDB(ctx context.Context, searchKey, searchValue string
|
|||
}
|
||||
|
||||
func FindFederationHostByFqdn(ctx context.Context, fqdn string) (*FederationHost, error) {
|
||||
return FindFederationHostFromDB(ctx, "host_fqdn=?", strings.ToLower(fqdn))
|
||||
return findFederationHostFromDB(ctx, "host_fqdn=?", strings.ToLower(fqdn))
|
||||
}
|
||||
|
||||
func FindFederationHostByKeyID(ctx context.Context, keyID string) (*FederationHost, error) {
|
||||
return FindFederationHostFromDB(ctx, "key_id=?", keyID)
|
||||
return findFederationHostFromDB(ctx, "key_id=?", keyID)
|
||||
}
|
||||
|
||||
func CreateFederationHost(ctx context.Context, host *FederationHost) error {
|
||||
|
|
Loading…
Add table
Reference in a new issue