Prepare for unit tests

This commit is contained in:
sonix 2026-03-22 12:51:13 +02:00
parent 309b240cdc
commit 4e7cf06abf
2 changed files with 14 additions and 2 deletions

1
.gitignore vendored
View file

@ -25,3 +25,4 @@ go.work.sum
# env file # env file
.env .env
main

View file

@ -10,10 +10,21 @@ import (
"vix.ro/sonix/azure_migrate/internal/forgejo" "vix.ro/sonix/azure_migrate/internal/forgejo"
) )
type AzureClient interface {
GetRepositories() ([]azure.Repository, error)
GetAuthenticatedURL(remoteURL, pat string) string
}
type ForgejoClient interface {
GetUser(username string) (*forgejo.User, error)
RepositoryExists(owner, name string) (bool, error)
CreateMirror(req forgejo.MigrateRequest) (*forgejo.Repository, error)
}
type Migrator struct { type Migrator struct {
config *config.Config config *config.Config
azureClient *azure.Client azureClient AzureClient
forgejoClient *forgejo.Client forgejoClient ForgejoClient
errors []error errors []error
mu sync.Mutex mu sync.Mutex
} }