Prepare for unit tests
This commit is contained in:
parent
309b240cdc
commit
4e7cf06abf
2 changed files with 14 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -25,3 +25,4 @@ go.work.sum
|
|||
# env file
|
||||
.env
|
||||
|
||||
main
|
||||
|
|
|
|||
|
|
@ -10,10 +10,21 @@ import (
|
|||
"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 {
|
||||
config *config.Config
|
||||
azureClient *azure.Client
|
||||
forgejoClient *forgejo.Client
|
||||
azureClient AzureClient
|
||||
forgejoClient ForgejoClient
|
||||
errors []error
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue