Skip to content

Commit 55d75ce

Browse files
committed
change directory architecture for other agent
1 parent 4d90005 commit 55d75ce

File tree

17 files changed

+27
-24
lines changed

17 files changed

+27
-24
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ WINDOWS=$(EXECUTABLE)_windows.exe
33
LINUX=$(EXECUTABLE)_linux
44
DARWIN=$(EXECUTABLE)_darwin
55
VERSION=$(shell cat VERSION)
6-
XPKG="github.com/jyny/outliner/pkg/cmd"
6+
XPKG="github.com/jyny/outliner/command"
77

88
all : build shell_completion
99
cp ./build/outliner_$(shell go env GOOS) ./outliner
@@ -19,7 +19,7 @@ build : mod embedded fmt
1919
env GOOS=windows GOARCH=amd64 go build -o ./build/$(WINDOWS) -ldflags="-X $(XPKG).version=$(VERSION)" .
2020

2121
embedded :
22-
@pushd pkg/agent > /dev/null && \
22+
@pushd pkg/deployer/ssh > /dev/null && \
2323
go run gen/gen.go \
2424
&& popd > /dev/null
2525

pkg/cmd/create.go command/create.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"github.com/spf13/cobra"

pkg/cmd/deploy.go command/deploy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"github.com/spf13/cobra"

pkg/cmd/destroy.go command/destroy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"github.com/spf13/cobra"

pkg/cmd/inspect.go command/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"github.com/spf13/cobra"

pkg/cmd/list.go command/list.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"github.com/spf13/cobra"

pkg/cmd/root.go command/root.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"os/user"
@@ -7,10 +7,13 @@ import (
77
"github.com/spf13/cobra"
88
"github.com/spf13/viper"
99

10-
"github.com/jyny/outliner/pkg/agent"
1110
ol "github.com/jyny/outliner/pkg/outliner"
1211
"github.com/jyny/outliner/pkg/util"
1312

13+
// deployer agnet
14+
"github.com/jyny/outliner/pkg/deployer/ssh"
15+
16+
// cloud provider
1417
"github.com/jyny/outliner/pkg/cloud/linode"
1518
//"github.com/jyny/outliner/pkg/cloud/vultr"
1619
//"github.com/jyny/outliner/pkg/cloud/digitalocean"
@@ -71,7 +74,7 @@ func init() {
7174
func initOutliner() {
7275
// register deployer agent
7376
deployer.RegisterAgent(
74-
agent.New(),
77+
ssh.NewAgent(),
7578
)
7679

7780
// Activate & register cloud providers

pkg/cmd/version.go command/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmd
1+
package command
22

33
import (
44
"github.com/spf13/cobra"

completion/gen.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package main
22

33
import (
4-
"github.com/jyny/outliner/pkg/cmd"
4+
"github.com/jyny/outliner/command"
55
)
66

77
func main() {
8-
err := cmd.RootCmd.GenBashCompletionFile("build/outliner_bash_completion")
8+
err := command.RootCmd.GenBashCompletionFile("build/outliner_bash_completion")
99
if err != nil {
1010
panic(err)
1111
}
12-
err = cmd.RootCmd.GenZshCompletionFile("build/outliner_zsh_completion")
12+
err = command.RootCmd.GenZshCompletionFile("build/outliner_zsh_completion")
1313
if err != nil {
1414
panic(err)
1515
}

main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"github.com/jyny/outliner/pkg/cmd"
4+
"github.com/jyny/outliner/command"
55
"log"
66
)
77

@@ -12,5 +12,5 @@ func main() {
1212
}
1313
}()
1414

15-
cmd.Execute()
15+
command.Execute()
1616
}

pkg/agent/ssh.go pkg/deployer/ssh/agent.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package agent
1+
package ssh
22

33
import (
44
"bufio"
@@ -14,7 +14,7 @@ import (
1414
"github.com/pkg/sftp"
1515
"golang.org/x/crypto/ssh"
1616

17-
"github.com/jyny/outliner/pkg/agent/consts"
17+
"github.com/jyny/outliner/pkg/deployer/ssh/consts"
1818
ol "github.com/jyny/outliner/pkg/outliner"
1919
)
2020

pkg/agent/consts/consts.go pkg/deployer/ssh/consts/consts.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const ScriptName = "./deploy.sh"
1010
const VariableName = "Script"
1111

1212
// PackageName for gen vfsdata
13-
const PackageName = "agent"
13+
const PackageName = "ssh"
1414

1515
// ssh key path
1616
const SSHKeyPubPath = "/.ssh/id_rsa.pub"

pkg/agent/gen/gen.go pkg/deployer/ssh/gen/gen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/shurcooL/vfsgen"
55
"net/http"
66

7-
"github.com/jyny/outliner/pkg/agent/consts"
7+
"github.com/jyny/outliner/pkg/deployer/ssh/consts"
88
)
99

1010
func main() {

pkg/agent/new.go pkg/deployer/ssh/new.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package agent
1+
package ssh
22

33
import (
44
"crypto/rand"
@@ -13,12 +13,12 @@ import (
1313
"path/filepath"
1414
"strings"
1515

16-
"github.com/jyny/outliner/pkg/agent/consts"
16+
"github.com/jyny/outliner/pkg/deployer/ssh/consts"
1717
ol "github.com/jyny/outliner/pkg/outliner"
1818
"github.com/jyny/outliner/pkg/util"
1919
)
2020

21-
func New() ol.Agent {
21+
func NewAgent() ol.Agent {
2222
certok := true
2323
u, _ := user.Current()
2424

File renamed without changes.

pkg/agent/script_vfsdata.go pkg/deployer/ssh/script_vfsdata.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

0 commit comments

Comments
 (0)