g2g/types.go

59 lines
1.1 KiB
Go
Raw Normal View History

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"`
}
// 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
}
// Config merge all config elements
2019-06-09 14:44:07 +02:00
type Config struct {
globalconfig GlobalConfig
gogsconfig GogsConfig
githubconfig GitHubConfig
}
// 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
}
// GitHubConfig is the GitHub config
2019-06-09 14:44:07 +02:00
type GitHubConfig struct {
StarsPages string
MaxPagesNumber int
AuthUsername string
AuthPassword string
ContentType string
}
// 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
}