From c4fee697bc4ad5de7f78fc53c30dcf7bb499029d Mon Sep 17 00:00:00 2001 From: famfo Date: Sun, 2 Mar 2025 22:32:46 +0100 Subject: [PATCH] fixup: add option to get FederationHost by KeyID --- models/forgefed/federationhost_repository.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/forgefed/federationhost_repository.go b/models/forgefed/federationhost_repository.go index 6c454163a7..fa1f906824 100644 --- a/models/forgefed/federationhost_repository.go +++ b/models/forgefed/federationhost_repository.go @@ -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 {