Skip to content

Commit d96032b

Browse files
authored
Merge pull request #16 from arvancloud/data_center_migration
Data center migration
2 parents 2d50567 + f798c09 commit d96032b

6 files changed

Lines changed: 283 additions & 85 deletions

File tree

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/docker/docker v20.10.0+incompatible // indirect
1313
github.com/fsouza/go-dockerclient v1.6.6 // indirect
1414
github.com/gonum/graph v0.0.0-20190426092945-678096d81a4b // indirect
15+
github.com/gosuri/uilive v0.0.4
1516
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
1617
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
1718
github.com/moby/buildkit v0.8.0 // indirect

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,8 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U
665665
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
666666
github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
667667
github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE=
668+
github.com/gosuri/uilive v0.0.4 h1:hUEBpQDj8D8jXgtCdBu7sWsy5sbW/5GhuO8KBwJ2jyY=
669+
github.com/gosuri/uilive v0.0.4/go.mod h1:V/epo5LjjlDE5RJUcqx8dbw+zc93y5Ya3yg8tfZ74VI=
668670
github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY=
669671
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
670672
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
@@ -834,6 +836,7 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx
834836
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
835837
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
836838
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
839+
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
837840
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
838841
github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o=
839842
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=

pkg/api/api.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
updateServer = "https://cli.arvan.run"
2222
)
2323

24-
//GetUserInfo returns a dictionary of user info if authentication credentials is valid.
24+
// GetUserInfo returns a dictionary of user info if authentication credentials is valid.
2525
func GetUserInfo(apikey string) (map[string]string, error) {
2626
arvanConfig := config.GetConfigInfo()
2727
arvanServer := arvanConfig.GetServer()
@@ -60,17 +60,16 @@ func GetUserInfo(apikey string) (map[string]string, error) {
6060
return user, nil
6161
}
6262

63-
64-
//GetZones from PaaS API
63+
// GetZones from PaaS API
6564
func GetZones() (config.Region, error) {
6665
var regions config.Region
6766
arvanConfig := config.GetConfigInfo()
6867
arvanURL, err := url.Parse(arvanConfig.GetServer())
6968
if err != nil {
7069
return regions, fmt.Errorf("invalid config")
7170
}
72-
73-
httpReq, err := http.NewRequest("GET", arvanURL.Scheme + "://" + arvanURL.Host+regionsEndpoint, nil)
71+
72+
httpReq, err := http.NewRequest("GET", arvanURL.Scheme+"://"+arvanURL.Host+regionsEndpoint, nil)
7473
if err != nil {
7574
return regions, err
7675
}

pkg/config/zone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ type Zone struct {
1919
RegionCity string `json:"region_city"`
2020
RegionCountry string `json:"region_country"`
2121
CreatedAt time.Time `json:"created_at"`
22-
}
22+
}

0 commit comments

Comments
 (0)