Skip to content

Commit 89fd2d9

Browse files
authored
Merge pull request #38 from airdb/dev
Dev
2 parents 100bb19 + 67839b3 commit 89fd2d9

File tree

10 files changed

+29
-64
lines changed

10 files changed

+29
-64
lines changed

.github/hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
# Step 1: gofmt, ignore gin-template files
1111
gofmt -w -s $(git rev-parse --show-toplevel) || true
12-
#golangci-lint run
12+
golangci-lint run

cmd/generate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
// statik zip data, `statik -include='*' -src gin-template/ -f`.
2626
_ "airdb.io/airdb/adb/statik"
27-
"github.com/airdb/sailor"
27+
"airdb.io/airdb/sailor/fileutil"
2828
"github.com/rakyll/statik/fs"
2929
"github.com/spf13/cobra"
3030
)
@@ -100,7 +100,7 @@ func generate(args []string) {
100100
return err
101101
}
102102

103-
err = sailor.TemplateGenerateFileFromReader(srcFile, projectDir, generateFlags)
103+
err = fileutil.TemplateGenerateFileFromReader(srcFile, projectDir, generateFlags)
104104
if err != nil {
105105
return err
106106
}

cmd/host.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/airdb/sailor"
7+
"airdb.io/airdb/sailor"
88
"github.com/aliyun/alibaba-cloud-sdk-go/services/alidns"
99
"github.com/spf13/cobra"
1010
)
@@ -30,7 +30,9 @@ func hostCmdInit() {
3030
}
3131

3232
hostSSHCmd.PersistentFlags().StringVarP(&sshFlags.LoginName, "login_name", "l", DefaultSSHUser, "login name")
33-
hostSSHCmd.PersistentFlags().StringVarP(&sshFlags.IdentityFile, "identity_file", "i", "~/.config/ssh/id_rsa", "identity file")
33+
hostSSHCmd.PersistentFlags().StringVarP(&sshFlags.IdentityFile, "identity_file", "i",
34+
"~/.config/ssh/id_rsa", "identity file")
35+
3436
sshFlags.Options = hostSSHCmd.PersistentFlags().StringSliceP("option", "o", sshOptions, "ssh option")
3537
hostSSHCmd.PersistentFlags().StringVarP(&sshFlags.SFTPDestPath, "sftp_server_path", "d", "/tmp",
3638
"sftp server dest path")

cmd/mysql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strings"
66

77
"airdb.io/airdb/adb/internal/adblib"
8-
"github.com/airdb/sailor"
8+
"airdb.io/airdb/sailor"
99
"github.com/aliyun/alibaba-cloud-sdk-go/services/alidns"
1010
"github.com/spf13/cobra"
1111
)

cmd/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"fmt"
2020

2121
"airdb.io/airdb/adb/internal/adblib"
22-
"github.com/airdb/sailor"
22+
"airdb.io/airdb/sailor"
2323
"github.com/aliyun/alibaba-cloud-sdk-go/services/alidns"
2424
"github.com/spf13/cobra"
2525
)

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,17 @@ module airdb.io/airdb/adb
33
go 1.15
44

55
require (
6+
airdb.io/airdb/sailor v0.0.3
67
github.com/AlecAivazis/survey/v2 v2.0.8
78
github.com/MakeNowJust/heredoc v1.0.0
8-
github.com/airdb/sailor v1.1.2-0.20200802151610-a033b3f2a246
99
github.com/aliyun/alibaba-cloud-sdk-go v1.61.279
1010
github.com/imroc/req v0.2.4
11-
github.com/json-iterator/go v1.1.10 // indirect
1211
github.com/minio/selfupdate v0.3.1
1312
github.com/mitchellh/go-homedir v1.1.0
1413
github.com/rakyll/statik v0.1.7
1514
github.com/slack-go/slack v0.6.5
1615
github.com/spf13/cobra v1.1.1
1716
github.com/spf13/viper v1.7.0
1817
github.com/tencentcloud/tencentcloud-sdk-go v1.0.12
19-
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
20-
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 // indirect
2118
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
2219
)

go.sum

Lines changed: 12 additions & 48 deletions
Large diffs are not rendered by default.

internal/adblib/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"encoding/json"
55
"path"
66

7+
"airdb.io/airdb/sailor/fileutil"
78
"github.com/AlecAivazis/survey/v2"
8-
"github.com/airdb/sailor"
99
"github.com/mitchellh/go-homedir"
1010
"github.com/spf13/viper"
1111
)
@@ -121,7 +121,7 @@ func SetAliyunConfig() error {
121121
return err
122122
}
123123

124-
err = sailor.WriteFile(aliyunConfigFile(), string(jsonByte))
124+
err = fileutil.WriteFile(aliyunConfigFile(), string(jsonByte))
125125
if err != nil {
126126
return err
127127
}
@@ -159,7 +159,7 @@ func SetSlackConfig() error {
159159
return err
160160
}
161161

162-
err = sailor.WriteFile(slackConfigFile(), string(jsonByte))
162+
err = fileutil.WriteFile(slackConfigFile(), string(jsonByte))
163163
if err != nil {
164164
return err
165165
}

internal/adblib/login.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package adblib
22

33
import (
4+
"airdb.io/airdb/sailor"
45
"fmt"
56
"time"
67

8+
"airdb.io/airdb/sailor/process"
79
"github.com/AlecAivazis/survey/v2"
8-
"github.com/airdb/sailor"
910
"github.com/imroc/req"
1011
)
1112

@@ -18,7 +19,7 @@ type User struct {
1819
func LoginWithToken() {
1920
fmt.Print(TokenRequest)
2021

21-
var bar sailor.ProcessBar
22+
var bar process.Bar
2223

2324
bar.NewOption(0, 100)
2425

internal/adblib/man.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ $ tcpdump commands
148148
`)
149149
S3Doc = heredoc.Doc(`
150150
# Minio
151+
wget https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2019-10-02T19-41-02Z
151152
wget https://dl.min.io/client/mc/release/linux-amd64/mc
152153
mc config host add <bucketname> https://s3.airdb.io <accessKey> <secretKey>
153154
`)

0 commit comments

Comments
 (0)