Skip to content

Commit

Permalink
add ResetPluginDir func
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyang.zhu committed Feb 23, 2024
1 parent b737fea commit a9bc83a
Show file tree
Hide file tree
Showing 76 changed files with 127 additions and 121 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# Getting Started

```
go install github.com/edwingeng/hotswap/cli/hotswap
go install github.com/sandwich-go/hotswap/cli/hotswap
```

# Build a Plugin from Source Code
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 安装

```
go install github.com/edwingeng/hotswap/cli/hotswap
go install github.com/sandwich-go/hotswap/cli/hotswap
```

# 编译插件
Expand Down
4 changes: 2 additions & 2 deletions cli/hotswap/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"text/template"
"time"

"github.com/edwingeng/hotswap/cli/hotswap/g"
"github.com/edwingeng/hotswap/internal/hutils"
"github.com/sandwich-go/hotswap/cli/hotswap/g"
"github.com/sandwich-go/hotswap/internal/hutils"
"github.com/spf13/cobra"
"golang.org/x/tools/go/packages"
)
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/cmd/hotswapStaticPluginInit.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package {{.PackageName}}

import (
"github.com/edwingeng/hotswap"
"github.com/sandwich-go/hotswap"
{{.PluginPkgName}} "{{.PluginPkgPath}}"
)

Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/cmd/hotswapStaticPlugins.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package {{.PackageName}}

import (
"github.com/edwingeng/hotswap"
"github.com/sandwich-go/hotswap"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cli/hotswap/hotswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"os"

"github.com/edwingeng/hotswap/cli/hotswap/cmd"
"github.com/edwingeng/hotswap/cli/hotswap/g"
"github.com/sandwich-go/hotswap/cli/hotswap/cmd"
"github.com/sandwich-go/hotswap/cli/hotswap/g"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/arya/exportX.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package arya

import (
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/arya"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/arya"
)

var (
Expand Down
8 changes: 4 additions & 4 deletions cli/hotswap/trial/arya/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"reflect"
"time"

"github.com/edwingeng/hotswap/cli/hotswap/trial/arya/needle"
"github.com/edwingeng/hotswap/cli/hotswap/trial/arya/pg"
"github.com/edwingeng/hotswap/internal/hctx"
"github.com/edwingeng/hotswap/vault"
"github.com/edwingeng/slog"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/arya/needle"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/arya/pg"
"github.com/sandwich-go/hotswap/internal/hctx"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
6 changes: 3 additions & 3 deletions cli/hotswap/trial/arya/needle/needle.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package needle
import (
"fmt"

"github.com/edwingeng/hotswap/cli/hotswap/trial/syrio"
"github.com/edwingeng/hotswap/internal/hctx"
"github.com/edwingeng/hotswap/internal/hutils"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/syrio"
"github.com/sandwich-go/hotswap/internal/hctx"
"github.com/sandwich-go/hotswap/internal/hutils"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/arya/pg/pg.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package pg

import "github.com/edwingeng/hotswap/vault"
import "github.com/sandwich-go/hotswap/vault"

var (
SharedVault *vault.Vault
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/cyclic1/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cyclic1

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/cyclic2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cyclic2
import (
"os"

"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/cyclic3/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cyclic3

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/hotswap.staticPlugins.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/hotswap/trial/importall/exportX.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package importall
import (
"errors"

"github.com/edwingeng/hotswap/cli/hotswap/trial/export/importall"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/importall"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions cli/hotswap/trial/importall/fx.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package importall

import (
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/arya"
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/snow"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/arya"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/snow"
)

var fx struct {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/importall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"strings"

"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/mismatch1/fx.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mismatch1

import (
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/snow"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/snow"
)

var fx struct {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/mismatch1/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mismatch1

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/mismatch2/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mismatch2

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/panics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"os"

"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/shadow1/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package shadow1

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/shadow2/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package shadow1

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/snow/exportX.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package snow

import "github.com/edwingeng/hotswap/cli/hotswap/trial/export/snow"
import "github.com/sandwich-go/hotswap/cli/hotswap/trial/export/snow"

var (
_ snow.Export = exportX{}
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/snow/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package snow

import (
"github.com/edwingeng/hotswap/vault"
"github.com/edwingeng/slog"
"github.com/sandwich-go/hotswap/vault"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/stubborn/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package stubborn

import (
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

func OnLoad(data interface{}) error {
Expand Down
6 changes: 3 additions & 3 deletions cli/hotswap/trial/xdep/fx.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package xdep

import (
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/arya"
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/importall"
"github.com/edwingeng/hotswap/cli/hotswap/trial/export/snow"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/arya"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/importall"
"github.com/sandwich-go/hotswap/cli/hotswap/trial/export/snow"
)

var fx struct {
Expand Down
2 changes: 1 addition & 1 deletion cli/hotswap/trial/xdep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package xdep
import (
"os"

"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/vault"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function printUsage() {
$colorful && tput setaf 7
}

go build -o cli/hotswap/hotswap github.com/edwingeng/hotswap/cli/hotswap
go build -o cli/hotswap/hotswap github.com/sandwich-go/hotswap/cli/hotswap
[[ $? -ne 0 ]] && exit 1

go test -trimpath -cover -coverpkg=github.com/edwingeng/hotswap -coverprofile=c.out -v "$@" \
go test -trimpath -cover -coverpkg=github.com/sandwich-go/hotswap -coverprofile=c.out -v "$@" \
&& go tool cover -html=c.out
6 changes: 3 additions & 3 deletions demo/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"syscall"
"time"

"github.com/edwingeng/hotswap"
"github.com/edwingeng/hotswap/demo/extension/g"
"github.com/edwingeng/hotswap/internal/hutils"
"github.com/sandwich-go/hotswap"
"github.com/sandwich-go/hotswap/demo/extension/g"
"github.com/sandwich-go/hotswap/internal/hutils"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion demo/extension/g/g.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package g

import (
"github.com/edwingeng/hotswap"
"github.com/edwingeng/slog"
"github.com/sandwich-go/hotswap"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions demo/extension/plugin/cat/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package cat

import (
"github.com/edwingeng/hotswap/demo/extension/g"
"github.com/edwingeng/hotswap/demo/extension/plugin/cat/meow"
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/demo/extension/g"
"github.com/sandwich-go/hotswap/demo/extension/plugin/cat/meow"
"github.com/sandwich-go/hotswap/vault"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion demo/extension/plugin/cat/meow/meow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package meow
import (
"strings"

"github.com/edwingeng/hotswap/demo/extension/g"
"github.com/sandwich-go/hotswap/demo/extension/g"
)

func Meow(pluginName string, compileTimeString string, repeat int) {
Expand Down
2 changes: 1 addition & 1 deletion demo/hello/g/g.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package g

import (
"github.com/edwingeng/hotswap"
"github.com/edwingeng/slog"
"github.com/sandwich-go/hotswap"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions demo/hello/hello.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"syscall"
"time"

"github.com/edwingeng/hotswap"
"github.com/edwingeng/hotswap/demo/hello/g"
"github.com/edwingeng/hotswap/internal/hutils"
"github.com/sandwich-go/hotswap"
"github.com/sandwich-go/hotswap/demo/hello/g"
"github.com/sandwich-go/hotswap/internal/hutils"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion demo/hello/plugin/world/hum/hum.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package hum
import (
"strings"

"github.com/edwingeng/hotswap/demo/hello/g"
"github.com/sandwich-go/hotswap/demo/hello/g"
)

func Hum(pluginName string, compileTimeString string, repeat int) {
Expand Down
6 changes: 3 additions & 3 deletions demo/hello/plugin/world/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package world

import (
"github.com/edwingeng/hotswap/demo/hello/g"
"github.com/edwingeng/hotswap/demo/hello/plugin/world/hum"
"github.com/edwingeng/hotswap/vault"
"github.com/sandwich-go/hotswap/demo/hello/g"
"github.com/sandwich-go/hotswap/demo/hello/plugin/world/hum"
"github.com/sandwich-go/hotswap/vault"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion demo/livex/g/g.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package g

import (
"github.com/edwingeng/hotswap"
"github.com/edwingeng/live"
"github.com/edwingeng/slog"
"github.com/edwingeng/tickque"
"github.com/sandwich-go/hotswap"
)

var (
Expand Down
Loading

0 comments on commit a9bc83a

Please sign in to comment.