about summary refs log tree commit diff stats
path: root/internal/config/repository.go
diff options
context:
space:
mode:
authorAlan Pearce2024-05-20 23:20:34 +0200
committerAlan Pearce2024-05-20 23:20:34 +0200
commit4ac6e917aafa02825bef4f213b2c41fd902a4baf (patch)
treeb8413ee22e62b91ab6d533084d640bd97d704638 /internal/config/repository.go
parente70431d68dced8754e94228753359b2130fd075a (diff)
downloadsearchix-4ac6e917aafa02825bef4f213b2c41fd902a4baf.tar.lz
searchix-4ac6e917aafa02825bef4f213b2c41fd902a4baf.tar.zst
searchix-4ac6e917aafa02825bef4f213b2c41fd902a4baf.zip
refactor: use enum for Repository.Type
Diffstat (limited to 'internal/config/repository.go')
-rw-r--r--internal/config/repository.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/config/repository.go b/internal/config/repository.go
index 44d8251..a074cbc 100644
--- a/internal/config/repository.go
+++ b/internal/config/repository.go
@@ -13,7 +13,7 @@ const (
 )
 
 type Repository struct {
-	Type     string `toml:""  default:"github" comment:"Currently only 'github' is supported."`
+	Type     RepoType `toml:""  default:"github" comment:"Currently only 'github' is supported."`
 	Owner    string
 	Repo     string
 	Revision string `toml:"-"`
@@ -43,3 +43,7 @@ func (f *RepoType) UnmarshalText(text []byte) error {
 
 	return err
 }
+
+func (f *RepoType) MarshalText() ([]byte, error) {
+	return []byte(f.String()), nil
+}