2019-06-09 14:44:07 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
|
|
|
// GitHubRepo githubrepo struct
|
|
|
|
type GitHubRepo struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
CloneURL string `json:"clone_url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// GogsOrg gogsrepo struct
|
|
|
|
type GogsOrg struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
Username string `json:"username"`
|
|
|
|
}
|
|
|
|
|
2019-07-08 00:12:25 +02:00
|
|
|
// GogsMigrateRepo defines the repo to migrate
|
2019-06-09 14:44:07 +02:00
|
|
|
type GogsMigrateRepo struct {
|
|
|
|
Name string
|
|
|
|
CloneURL string
|
|
|
|
UID int
|
|
|
|
Mirror bool
|
|
|
|
}
|
|
|
|
|
2019-07-08 00:12:25 +02:00
|
|
|
// Config merge all config elements
|
2019-06-09 14:44:07 +02:00
|
|
|
type Config struct {
|
|
|
|
globalconfig GlobalConfig
|
|
|
|
gogsconfig GogsConfig
|
|
|
|
githubconfig GitHubConfig
|
|
|
|
}
|
|
|
|
|
2019-07-08 00:12:25 +02:00
|
|
|
// GlobalConfig is the global config of github-to-gogs
|
2019-06-09 14:44:07 +02:00
|
|
|
type GlobalConfig struct {
|
|
|
|
RequestTimeout time.Duration
|
|
|
|
UserAgent string
|
2019-07-10 15:07:41 +02:00
|
|
|
Threads int
|
2019-06-09 14:44:07 +02:00
|
|
|
}
|
|
|
|
|
2019-07-08 00:12:25 +02:00
|
|
|
// GitHubConfig is the GitHub config
|
2019-06-09 14:44:07 +02:00
|
|
|
type GitHubConfig struct {
|
2019-07-10 15:07:41 +02:00
|
|
|
MaxPerPage int
|
|
|
|
PageNum int
|
|
|
|
AuthUsername string
|
|
|
|
AuthPassword string
|
|
|
|
ContentType string
|
2019-06-09 14:44:07 +02:00
|
|
|
}
|
|
|
|
|
2019-07-08 00:12:25 +02:00
|
|
|
// GogsConfig is the Gogs config
|
2019-06-09 14:44:07 +02:00
|
|
|
type GogsConfig struct {
|
|
|
|
UID int
|
|
|
|
Username string
|
|
|
|
DestUsername string
|
|
|
|
RepoURLTmpl string
|
|
|
|
OrgsURLTmpl string
|
|
|
|
MigrateURL string
|
|
|
|
AuthToken string
|
|
|
|
ContentType string
|
|
|
|
Mirror bool
|
|
|
|
}
|