From d37f7e0e4d536515ee44ef564b42baf0a0dbc358 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 20 Nov 2025 23:28:50 -0300 Subject: [PATCH] nip34: String() methods to repository and state. --- nip34/repository.go | 6 ++++++ nip34/state.go | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/nip34/repository.go b/nip34/repository.go index d524d06..66d07ee 100644 --- a/nip34/repository.go +++ b/nip34/repository.go @@ -1,6 +1,8 @@ package nip34 import ( + "fmt" + "fiatjaf.com/nostr" ) @@ -100,3 +102,7 @@ func (r Repository) ToEvent() nostr.Event { CreatedAt: nostr.Now(), } } + +func (r Repository) String() string { + return fmt.Sprintf("Repository{ID: %s, Name: %s, Description: %s, Web: %v, Clone: %v, Relays: %v, EarliestUniqueCommitID: %s, Maintainers: %v}", r.ID, r.Name, r.Description, r.Web, r.Clone, r.Relays, r.EarliestUniqueCommitID, r.Maintainers) +} diff --git a/nip34/state.go b/nip34/state.go index f1dc935..e6807d9 100644 --- a/nip34/state.go +++ b/nip34/state.go @@ -1,6 +1,7 @@ package nip34 import ( + "fmt" "strings" "fiatjaf.com/nostr" @@ -65,3 +66,7 @@ func (rs RepositoryState) ToEvent() nostr.Event { CreatedAt: nostr.Now(), } } + +func (rs RepositoryState) String() string { + return fmt.Sprintf("RepositoryState{ID: %s, HEAD: %s, Tags: %v, Branches: %v}", rs.ID, rs.HEAD, rs.Tags, rs.Branches) +}