Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar
Commits
b0d3bccb
Commit
b0d3bccb
authored
Oct 26, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
😘
insteadof go mod path
parent
0cdf9a37
Pipeline
#8169
failed with stages
Changes
66
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
155 additions
and
155 deletions
+155
-155
notify.yml
.github/workflows/notify.yml
+1
-1
Dockerfile
Dockerfile
+4
-4
Makefile
Makefile
+2
-2
README.md
README.md
+1
-1
server.go
api/server.go
+5
-5
appchain.go
cmd/sidecar/appchain.go
+3
-3
appchain.go
cmd/sidecar/client/appchain.go
+1
-1
http.go
cmd/sidecar/client/http.go
+1
-1
did.go
cmd/sidecar/did.go
+3
-3
governance.go
cmd/sidecar/governance.go
+2
-2
id.go
cmd/sidecar/id.go
+1
-1
init.go
cmd/sidecar/init.go
+2
-2
interchain.go
cmd/sidecar/interchain.go
+3
-3
p2p.go
cmd/sidecar/p2p.go
+1
-1
rule.go
cmd/sidecar/rule.go
+2
-2
sidecar.go
cmd/sidecar/sidecar.go
+1
-1
start.go
cmd/sidecar/start.go
+6
-6
tool.go
cmd/sidecar/tool.go
+1
-1
version.go
cmd/sidecar/version.go
+1
-1
go.mod
go.mod
+1
-1
client.go
hub/client/client.go
+2
-2
config.go
hub/client/config.go
+2
-2
mock_client.go
hub/client/mock_client/mock_client.go
+2
-2
types.go
hub/client/types.go
+1
-1
sidecar.go
internal/app/sidecar.go
+13
-13
appchain.go
internal/appchain/appchain.go
+5
-5
executor.go
internal/appchain/executor.go
+1
-1
mock_executor.go
internal/appchain/mock_executor/mock_executor.go
+1
-1
mock_monitor.go
internal/appchain/mock_monitor/mock_monitor.go
+1
-1
monitor.go
internal/appchain/monitor.go
+1
-1
port.go
internal/appchain/port.go
+3
-3
checker.go
internal/checker/checker.go
+2
-2
checker_test.go
internal/checker/checker_test.go
+1
-1
interface.go
internal/checker/interface.go
+1
-1
pool.go
internal/exchanger/pool.go
+1
-1
logger_test.go
internal/loggers/logger_test.go
+1
-1
loggers.go
internal/loggers/loggers.go
+2
-2
manager.go
internal/manger/manager.go
+3
-3
handler.go
internal/peermgr/handler.go
+1
-1
local.go
internal/peermgr/local.go
+2
-2
mock_peermgr.go
internal/peermgr/mock_peermgr/mock_peermgr.go
+3
-3
peermgr.go
internal/peermgr/peermgr.go
+3
-3
peermgr_test.go
internal/peermgr/peermgr_test.go
+5
-5
port.go
internal/peermgr/port.go
+2
-2
swarm.go
internal/peermgr/swarm.go
+4
-4
port.go
internal/port/port.go
+1
-1
config.go
internal/repo/config.go
+1
-1
interface.go
internal/router/interface.go
+3
-3
mock_router.go
internal/router/mock_router/mock_router.go
+2
-2
router.go
internal/router/router.go
+4
-4
handle.go
internal/rulemgr/handle.go
+2
-2
agent.go
internal/syncer/agent.go
+3
-3
config.go
internal/syncer/config.go
+2
-2
interface.go
internal/syncer/interface.go
+2
-2
mock_syncer.go
internal/syncer/mock_syncer/mock_syncer.go
+2
-2
persist.go
internal/syncer/persist.go
+1
-1
syncer.go
internal/syncer/syncer.go
+2
-2
syncer_test.go
internal/syncer/syncer_test.go
+6
-6
cryptor.go
internal/txcrypto/cryptor.go
+3
-3
txcrypto_test.go
internal/txcrypto/txcrypto_test.go
+4
-4
grpc.go
pkg/plugins/grpc.go
+1
-1
interface.go
pkg/plugins/interface.go
+2
-2
mock_client.go
pkg/plugins/mock_client/mock_client.go
+2
-2
plugin.go
pkg/plugins/plugin.go
+1
-1
start.go
pkg/plugins/start.go
+2
-2
plugin_test.go
pkg/plugins/test/plugin_test.go
+4
-4
No files found.
.github/workflows/notify.yml
View file @
b0d3bccb
...
@@ -16,5 +16,5 @@ jobs:
...
@@ -16,5 +16,5 @@ jobs:
uses
:
lijinke666/ding-talk-pr-notify@main
uses
:
lijinke666/ding-talk-pr-notify@main
with
:
with
:
ding_talk_token
:
${{ secrets.DING_TALK_ACCESS_TOKEN }}
ding_talk_token
:
${{ secrets.DING_TALK_ACCESS_TOKEN }}
repo_url
:
https://git
hub.com
/link33/sidecar/pull
repo_url
:
https://git
lab.33.cn
/link33/sidecar/pull
at_all
:
false
at_all
:
false
Dockerfile
View file @
b0d3bccb
# use : docker build --build-arg PLUGIN_URL=https://git
hub.com
/link33/sidecar-client-fabric --build-arg PLUGIN_VERSION=v1.0.0-rc2 -t sidecar:1.0.0 .
# use : docker build --build-arg PLUGIN_URL=https://git
lab.33.cn
/link33/sidecar-client-fabric --build-arg PLUGIN_VERSION=v1.0.0-rc2 -t sidecar:1.0.0 .
FROM
golang:1.17 as builder
FROM
golang:1.17 as builder
RUN
mkdir
-p
/go/src/git
hub.com
/link33/sidecar
RUN
mkdir
-p
/go/src/git
lab.33.cn
/link33/sidecar
WORKDIR
/go/src/git
hub.com
/link33/sidecar
WORKDIR
/go/src/git
lab.33.cn
/link33/sidecar
# Cache dependencies
# Cache dependencies
COPY
go.mod .
COPY
go.mod .
...
@@ -19,7 +19,7 @@ RUN go get -u github.com/gobuffalo/packr/packr
...
@@ -19,7 +19,7 @@ RUN go get -u github.com/gobuffalo/packr/packr
RUN
make
install
RUN
make
install
RUN
cd
..
&&
\
RUN
cd
..
&&
\
git clone https://git
hub.com
/link33/sidecar-client-fabric.git
&&
\
git clone https://git
lab.33.cn
/link33/sidecar-client-fabric.git
&&
\
cd
sidecar-client-fabric
&&
\
cd
sidecar-client-fabric
&&
\
git checkout v1.1.0-rc1
&&
\
git checkout v1.1.0-rc1
&&
\
make fabric1.4
&&
\
make fabric1.4
&&
\
...
...
Makefile
View file @
b0d3bccb
...
@@ -10,7 +10,7 @@ CURRENT_PATH = $(shell pwd)
...
@@ -10,7 +10,7 @@ CURRENT_PATH = $(shell pwd)
APP_NAME
=
sidecar
APP_NAME
=
sidecar
# build with verison infos
# build with verison infos
VERSION_DIR
=
git
hub.com
/link33/
${
APP_NAME
}
VERSION_DIR
=
git
lab.33.cn
/link33/
${
APP_NAME
}
BUILD_DATE
=
$(
shell
date
+%FT%T
)
BUILD_DATE
=
$(
shell
date
+%FT%T
)
GIT_COMMIT
=
$(
shell
git log
--pretty
=
format:
'%h'
-n
1
)
GIT_COMMIT
=
$(
shell
git log
--pretty
=
format:
'%h'
-n
1
)
GIT_BRANCH
=
$(
shell
git rev-parse
--abbrev-ref
HEAD
)
GIT_BRANCH
=
$(
shell
git rev-parse
--abbrev-ref
HEAD
)
...
@@ -166,7 +166,7 @@ aligner:
...
@@ -166,7 +166,7 @@ aligner:
@
aligner
-r
-c
"//"
-e
".go"
-i
./internal/repo/a_repo-packr.go comment
@
aligner
-r
-c
"//"
-e
".go"
-i
./internal/repo/a_repo-packr.go comment
goimports
:
fmt
goimports
:
fmt
@
CGO_ENABLED
=
1 goimports-reviser
-dir-path
./
-project-name
git
hub.com
/link33/sidecar
-ignore-dir
mock
-rm-unused
-set-alias
-format
@
CGO_ENABLED
=
1 goimports-reviser
-dir-path
./
-project-name
git
lab.33.cn
/link33/sidecar
-ignore-dir
mock
-rm-unused
-set-alias
-format
aligner-check
:
aligner-check
:
@
aligner
-r
-c
"//"
-e
".go"
-i
./internal/repo/a_repo-packr.go check
@
aligner
-r
-c
"//"
-e
".go"
-i
./internal/repo/a_repo-packr.go check
...
...
README.md
View file @
b0d3bccb
# sidecar
# sidecar
![
build
](
https://git
hub.com
/link33/sidecar/workflows/build/badge.svg
)
![
build
](
https://git
lab.33.cn
/link33/sidecar/workflows/build/badge.svg
)
[
![codecov
](
https://codecov.io/gh/link33/sidecar/branch/master/graph/badge.svg
)
](https://codecov.io/gh/link33/sidecar)
[
![codecov
](
https://codecov.io/gh/link33/sidecar/branch/master/graph/badge.svg
)
](https://codecov.io/gh/link33/sidecar)
## Build
## Build
...
...
api/server.go
View file @
b0d3bccb
...
@@ -12,11 +12,11 @@ import (
...
@@ -12,11 +12,11 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/cmd/sidecar/client"
"git
lab.33.cn
/link33/sidecar/cmd/sidecar/client"
"git
hub.com
/link33/sidecar/internal/peermgr"
"git
lab.33.cn
/link33/sidecar/internal/peermgr"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/internal/rulemgr"
"git
lab.33.cn
/link33/sidecar/internal/rulemgr"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
Server
struct
{
type
Server
struct
{
...
...
cmd/sidecar/appchain.go
View file @
b0d3bccb
...
@@ -13,9 +13,9 @@ import (
...
@@ -13,9 +13,9 @@ import (
"github.com/tidwall/gjson"
"github.com/tidwall/gjson"
"github.com/urfave/cli"
"github.com/urfave/cli"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
)
)
var
appchainBxhCMD
=
cli
.
Command
{
var
appchainBxhCMD
=
cli
.
Command
{
...
...
cmd/sidecar/client/appchain.go
View file @
b0d3bccb
...
@@ -11,7 +11,7 @@ import (
...
@@ -11,7 +11,7 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
)
)
type
Approve
struct
{
type
Approve
struct
{
...
...
cmd/sidecar/client/http.go
View file @
b0d3bccb
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
)
)
const
(
const
(
...
...
cmd/sidecar/did.go
View file @
b0d3bccb
...
@@ -10,9 +10,9 @@ import (
...
@@ -10,9 +10,9 @@ import (
"github.com/meshplus/bitxid"
"github.com/meshplus/bitxid"
"github.com/urfave/cli"
"github.com/urfave/cli"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
)
)
const
(
const
(
...
...
cmd/sidecar/governance.go
View file @
b0d3bccb
...
@@ -5,8 +5,8 @@ import (
...
@@ -5,8 +5,8 @@ import (
"github.com/urfave/cli"
"github.com/urfave/cli"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
)
)
var
governanceCMD
=
cli
.
Command
{
var
governanceCMD
=
cli
.
Command
{
...
...
cmd/sidecar/id.go
View file @
b0d3bccb
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
)
)
var
idCMD
=
cli
.
Command
{
var
idCMD
=
cli
.
Command
{
...
...
cmd/sidecar/init.go
View file @
b0d3bccb
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
var
initCMD
=
cli
.
Command
{
var
initCMD
=
cli
.
Command
{
...
...
cmd/sidecar/interchain.go
View file @
b0d3bccb
...
@@ -6,9 +6,9 @@ import (
...
@@ -6,9 +6,9 @@ import (
"github.com/meshplus/bitxhub-kit/types"
"github.com/meshplus/bitxhub-kit/types"
"github.com/urfave/cli"
"github.com/urfave/cli"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
)
)
var
interchainCMD
=
cli
.
Command
{
var
interchainCMD
=
cli
.
Command
{
...
...
cmd/sidecar/p2p.go
View file @
b0d3bccb
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
)
)
var
p2pCMD
=
cli
.
Command
{
var
p2pCMD
=
cli
.
Command
{
...
...
cmd/sidecar/rule.go
View file @
b0d3bccb
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
"github.com/tidwall/gjson"
"github.com/tidwall/gjson"
"github.com/urfave/cli"
"github.com/urfave/cli"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
)
)
var
ruleCMD
=
cli
.
Command
{
var
ruleCMD
=
cli
.
Command
{
...
...
cmd/sidecar/sidecar.go
View file @
b0d3bccb
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/fatih/color"
"github.com/fatih/color"
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/pkg/log"
"git
lab.33.cn
/link33/sidecar/pkg/log"
)
)
var
logger
=
log
.
NewWithModule
(
"cmd"
)
var
logger
=
log
.
NewWithModule
(
"cmd"
)
...
...
cmd/sidecar/start.go
View file @
b0d3bccb
...
@@ -14,12 +14,12 @@ import (
...
@@ -14,12 +14,12 @@ import (
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/internal"
"git
lab.33.cn
/link33/sidecar/internal"
"git
hub.com
/link33/sidecar/internal/app"
"git
lab.33.cn
/link33/sidecar/internal/app"
"git
hub.com
/link33/sidecar/internal/loggers"
"git
lab.33.cn
/link33/sidecar/internal/loggers"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/pkg/log"
"git
lab.33.cn
/link33/sidecar/pkg/log"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
var
startCMD
=
cli
.
Command
{
var
startCMD
=
cli
.
Command
{
...
...
cmd/sidecar/tool.go
View file @
b0d3bccb
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
var
toolCMD
=
cli
.
Command
{
var
toolCMD
=
cli
.
Command
{
...
...
cmd/sidecar/version.go
View file @
b0d3bccb
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"github.com/urfave/cli"
"github.com/urfave/cli"
"git
hub.com
/link33/sidecar"
"git
lab.33.cn
/link33/sidecar"
)
)
var
versionCMD
=
cli
.
Command
{
var
versionCMD
=
cli
.
Command
{
...
...
go.mod
View file @
b0d3bccb
module git
hub.com
/link33/sidecar
module git
lab.33.cn
/link33/sidecar
go 1.17
go 1.17
...
...
hub/client/client.go
View file @
b0d3bccb
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/types"
"github.com/meshplus/bitxhub-kit/types"
"git
hub.com
/link33/sidecar/internal"
"git
lab.33.cn
/link33/sidecar/internal"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
SubscriptionType
int
type
SubscriptionType
int
...
...
hub/client/config.go
View file @
b0d3bccb
...
@@ -6,8 +6,8 @@ import (
...
@@ -6,8 +6,8 @@ import (
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/crypto"
"git
hub.com
/link33/sidecar/pkg/log"
"git
lab.33.cn
/link33/sidecar/pkg/log"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
const
(
const
(
...
...
hub/client/mock_client/mock_client.go
View file @
b0d3bccb
...
@@ -9,8 +9,8 @@ import (
...
@@ -9,8 +9,8 @@ import (
reflect
"reflect"
reflect
"reflect"
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
crypto
"github.com/meshplus/bitxhub-kit/crypto"
crypto
"github.com/meshplus/bitxhub-kit/crypto"
types
"github.com/meshplus/bitxhub-kit/types"
types
"github.com/meshplus/bitxhub-kit/types"
)
)
...
...
hub/client/types.go
View file @
b0d3bccb
...
@@ -3,7 +3,7 @@ package rpcx
...
@@ -3,7 +3,7 @@ package rpcx
import
(
import
(
"fmt"
"fmt"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
func
Int32
(
i
int32
)
*
pb
.
Arg
{
func
Int32
(
i
int32
)
*
pb
.
Arg
{
...
...
internal/app/sidecar.go
View file @
b0d3bccb
...
@@ -10,19 +10,19 @@ import (
...
@@ -10,19 +10,19 @@ import (
"github.com/meshplus/bitxhub-kit/storage/leveldb"
"github.com/meshplus/bitxhub-kit/storage/leveldb"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/api"
"git
lab.33.cn
/link33/sidecar/api"
_
"git
hub.com
/link33/sidecar/imports"
_
"git
lab.33.cn
/link33/sidecar/imports"
"git
hub.com
/link33/sidecar/internal"
"git
lab.33.cn
/link33/sidecar/internal"
"git
hub.com
/link33/sidecar/internal/appchain"
"git
lab.33.cn
/link33/sidecar/internal/appchain"
"git
hub.com
/link33/sidecar/internal/loggers"
"git
lab.33.cn
/link33/sidecar/internal/loggers"
"git
hub.com
/link33/sidecar/internal/manger"
"git
lab.33.cn
/link33/sidecar/internal/manger"
"git
hub.com
/link33/sidecar/internal/peermgr"
"git
lab.33.cn
/link33/sidecar/internal/peermgr"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/internal/router"
"git
lab.33.cn
/link33/sidecar/internal/router"
"git
hub.com
/link33/sidecar/internal/rulemgr"
"git
lab.33.cn
/link33/sidecar/internal/rulemgr"
"git
hub.com
/link33/sidecar/internal/txcrypto"
"git
lab.33.cn
/link33/sidecar/internal/txcrypto"
"git
hub.com
/link33/sidecar/pkg/plugins"
"git
lab.33.cn
/link33/sidecar/pkg/plugins"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
// App represents the necessary data for starting the sidecar app
// App represents the necessary data for starting the sidecar app
...
...
internal/appchain/appchain.go
View file @
b0d3bccb
...
@@ -11,11 +11,11 @@ import (
...
@@ -11,11 +11,11 @@ import (
"github.com/Rican7/retry/strategy"
"github.com/Rican7/retry/strategy"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/internal/txcrypto"
"git
lab.33.cn
/link33/sidecar/internal/txcrypto"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
"git
hub.com
/link33/sidecar/pkg/plugins"
"git
lab.33.cn
/link33/sidecar/pkg/plugins"
)
)
type
AppChain
interface
{
type
AppChain
interface
{
...
...
internal/appchain/executor.go
View file @
b0d3bccb
package
appchain
package
appchain
import
(
import
(
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
//go:generate mockgen -destination mock_executor/mock_executor.go -package mock_executor -source executor.go
//go:generate mockgen -destination mock_executor/mock_executor.go -package mock_executor -source executor.go
...
...
internal/appchain/mock_executor/mock_executor.go
View file @
b0d3bccb
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
reflect
"reflect"
reflect
"reflect"
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// MockExecutor is a mock of Executor interface.
// MockExecutor is a mock of Executor interface.
...
...
internal/appchain/mock_monitor/mock_monitor.go
View file @
b0d3bccb
...
@@ -8,7 +8,7 @@ import (
...
@@ -8,7 +8,7 @@ import (
reflect
"reflect"
reflect
"reflect"
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// MockMonitor is a mock of Monitor interface.
// MockMonitor is a mock of Monitor interface.
...
...
internal/appchain/monitor.go
View file @
b0d3bccb
package
appchain
package
appchain
import
"git
hub.com
/link33/sidecar/model/pb"
import
"git
lab.33.cn
/link33/sidecar/model/pb"
//go:generate mockgen -destination mock_monitor/mock_monitor.go -package mock_monitor -source monitor.go
//go:generate mockgen -destination mock_monitor/mock_monitor.go -package mock_monitor -source monitor.go
type
Monitor
interface
{
type
Monitor
interface
{
...
...
internal/appchain/port.go
View file @
b0d3bccb
...
@@ -3,9 +3,9 @@ package appchain
...
@@ -3,9 +3,9 @@ package appchain
import
(
import
(
"errors"
"errors"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/internal/router"
"git
lab.33.cn
/link33/sidecar/internal/router"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
func
(
a
*
appChain
)
ID
()
string
{
func
(
a
*
appChain
)
ID
()
string
{
...
...
internal/checker/checker.go
View file @
b0d3bccb
...
@@ -4,8 +4,8 @@ import (
...
@@ -4,8 +4,8 @@ import (
"fmt"
"fmt"
"sync"
"sync"
"git
hub.com
/link33/sidecar/internal/rulemgr"
"git
lab.33.cn
/link33/sidecar/internal/rulemgr"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
MockChecker
struct
{}
type
MockChecker
struct
{}
...
...
internal/checker/checker_test.go
View file @
b0d3bccb
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
const
(
const
(
...
...
internal/checker/interface.go
View file @
b0d3bccb
package
checker
package
checker
import
"git
hub.com
/link33/sidecar/model/pb"
import
"git
lab.33.cn
/link33/sidecar/model/pb"
type
Checker
interface
{
type
Checker
interface
{
Check
(
ibtp
*
pb
.
IBTP
)
error
Check
(
ibtp
*
pb
.
IBTP
)
error
...
...
internal/exchanger/pool.go
View file @
b0d3bccb
...
@@ -3,7 +3,7 @@ package exchanger
...
@@ -3,7 +3,7 @@ package exchanger
import
(
import
(
"sync"
"sync"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
Pool
struct
{
type
Pool
struct
{
...
...
internal/loggers/logger_test.go
View file @
b0d3bccb
...
@@ -5,7 +5,7 @@ import (
...
@@ -5,7 +5,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
)
)
func
TestLogger
(
t
*
testing
.
T
)
{
func
TestLogger
(
t
*
testing
.
T
)
{
...
...
internal/loggers/loggers.go
View file @
b0d3bccb
...
@@ -3,8 +3,8 @@ package loggers
...
@@ -3,8 +3,8 @@ package loggers
import
(
import
(
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/pkg/log"
"git
lab.33.cn
/link33/sidecar/pkg/log"
)
)
const
(
const
(
...
...
internal/manger/manager.go
View file @
b0d3bccb
...
@@ -6,9 +6,9 @@ import (
...
@@ -6,9 +6,9 @@ import (
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/internal/peermgr"
"git
lab.33.cn
/link33/sidecar/internal/peermgr"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
Manager
struct
{
type
Manager
struct
{
...
...
internal/peermgr/handler.go
View file @
b0d3bccb
...
@@ -3,7 +3,7 @@ package peermgr
...
@@ -3,7 +3,7 @@ package peermgr
import
(
import
(
"fmt"
"fmt"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
func
(
swarm
*
Swarm
)
RegisterMultiMsgHandler
(
messageTypes
[]
pb
.
Message_Type
,
handler
MessageHandler
)
error
{
func
(
swarm
*
Swarm
)
RegisterMultiMsgHandler
(
messageTypes
[]
pb
.
Message_Type
,
handler
MessageHandler
)
error
{
...
...
internal/peermgr/local.go
View file @
b0d3bccb
...
@@ -7,8 +7,8 @@ import (
...
@@ -7,8 +7,8 @@ import (
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
var
(
var
(
...
...
internal/peermgr/mock_peermgr/mock_peermgr.go
View file @
b0d3bccb
...
@@ -9,9 +9,9 @@ import (
...
@@ -9,9 +9,9 @@ import (
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
peer
"github.com/libp2p/go-libp2p-core/peer"
peer
"github.com/libp2p/go-libp2p-core/peer"
peermgr
"git
hub.com
/link33/sidecar/internal/peermgr"
peermgr
"git
lab.33.cn
/link33/sidecar/internal/peermgr"
port
"git
hub.com
/link33/sidecar/internal/port"
port
"git
lab.33.cn
/link33/sidecar/internal/port"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// MockPeerManager is a mock of PeerManager interface.
// MockPeerManager is a mock of PeerManager interface.
...
...
internal/peermgr/peermgr.go
View file @
b0d3bccb
...
@@ -3,9 +3,9 @@ package peermgr
...
@@ -3,9 +3,9 @@ package peermgr
import
(
import
(
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peer"
"git
hub.com
/link33/sidecar/internal"
"git
lab.33.cn
/link33/sidecar/internal"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
(
type
(
...
...
internal/peermgr/peermgr_test.go
View file @
b0d3bccb
...
@@ -13,11 +13,11 @@ import (
...
@@ -13,11 +13,11 @@ import (
ma
"github.com/multiformats/go-multiaddr"
ma
"github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
router2
"git
hub.com
/link33/sidecar/internal/router"
router2
"git
lab.33.cn
/link33/sidecar/internal/router"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
"git
hub.com
/link33/sidecar/pkg/log"
"git
lab.33.cn
/link33/sidecar/pkg/log"
)
)
var
routerTmp
router2
.
Router
var
routerTmp
router2
.
Router
...
...
internal/peermgr/port.go
View file @
b0d3bccb
package
peermgr
package
peermgr
import
(
import
(
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
sidecar
struct
{
type
sidecar
struct
{
...
...
internal/peermgr/swarm.go
View file @
b0d3bccb
...
@@ -14,10 +14,10 @@ import (
...
@@ -14,10 +14,10 @@ import (
network
"github.com/meshplus/go-lightp2p"
network
"github.com/meshplus/go-lightp2p"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/internal/router"
"git
lab.33.cn
/link33/sidecar/internal/router"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
const
(
const
(
...
...
internal/port/port.go
View file @
b0d3bccb
package
port
package
port
import
(
import
(
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// 设计一套port管理机制:包括各种的管理模块。
// 设计一套port管理机制:包括各种的管理模块。
...
...
internal/repo/config.go
View file @
b0d3bccb
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/spf13/viper"
"github.com/spf13/viper"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
const
(
const
(
...
...
internal/router/interface.go
View file @
b0d3bccb
package
router
package
router
import
(
import
(
"git
hub.com
/link33/sidecar/internal"
"git
lab.33.cn
/link33/sidecar/internal"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
//go:generate mockgen -destination mock_router/mock_router.go -package mock_router -source interface.go
//go:generate mockgen -destination mock_router/mock_router.go -package mock_router -source interface.go
...
...
internal/router/mock_router/mock_router.go
View file @
b0d3bccb
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
reflect
"reflect"
reflect
"reflect"
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
port
"git
hub.com
/link33/sidecar/internal/port"
port
"git
lab.33.cn
/link33/sidecar/internal/port"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// MockRouter is a mock of Router interface.
// MockRouter is a mock of Router interface.
...
...
internal/router/router.go
View file @
b0d3bccb
...
@@ -8,10 +8,10 @@ import (
...
@@ -8,10 +8,10 @@ import (
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/meshplus/bitxhub-kit/crypto"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
"git
hub.com
/link33/sidecar/internal/checker"
"git
lab.33.cn
/link33/sidecar/internal/checker"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
router
struct
{
type
router
struct
{
...
...
internal/rulemgr/handle.go
View file @
b0d3bccb
...
@@ -5,8 +5,8 @@ import (
...
@@ -5,8 +5,8 @@ import (
"github.com/meshplus/bitxhub-kit/types"
"github.com/meshplus/bitxhub-kit/types"
"git
hub.com
/link33/sidecar/internal/port"
"git
lab.33.cn
/link33/sidecar/internal/port"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
func
(
rm
*
RuleMgr
)
HandleRule
(
p
port
.
Port
,
msg
*
pb
.
Message
)
{
func
(
rm
*
RuleMgr
)
HandleRule
(
p
port
.
Port
,
msg
*
pb
.
Message
)
{
...
...
internal/syncer/agent.go
View file @
b0d3bccb
...
@@ -9,9 +9,9 @@ import (
...
@@ -9,9 +9,9 @@ import (
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
"github.com/meshplus/bitxhub-kit/types"
"github.com/meshplus/bitxhub-kit/types"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
const
(
const
(
...
...
internal/syncer/config.go
View file @
b0d3bccb
...
@@ -4,8 +4,8 @@ import (
...
@@ -4,8 +4,8 @@ import (
"github.com/meshplus/bitxhub-kit/storage"
"github.com/meshplus/bitxhub-kit/storage"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
)
)
type
Config
struct
{
type
Config
struct
{
...
...
internal/syncer/interface.go
View file @
b0d3bccb
...
@@ -3,8 +3,8 @@ package syncer
...
@@ -3,8 +3,8 @@ package syncer
import
(
import
(
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
type
IBTPHandler
func
(
ibtp
*
pb
.
IBTP
)
type
IBTPHandler
func
(
ibtp
*
pb
.
IBTP
)
...
...
internal/syncer/mock_syncer/mock_syncer.go
View file @
b0d3bccb
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
reflect
"reflect"
reflect
"reflect"
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
syncer
"git
hub.com
/link33/sidecar/internal/syncer"
syncer
"git
lab.33.cn
/link33/sidecar/internal/syncer"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
appchain_mgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
appchain_mgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
)
)
...
...
internal/syncer/persist.go
View file @
b0d3bccb
...
@@ -4,7 +4,7 @@ import (
...
@@ -4,7 +4,7 @@ import (
"fmt"
"fmt"
"strconv"
"strconv"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
func
(
syncer
*
WrapperSyncer
)
persist
(
ws
*
pb
.
InterchainTxWrappers
)
error
{
func
(
syncer
*
WrapperSyncer
)
persist
(
ws
*
pb
.
InterchainTxWrappers
)
error
{
...
...
internal/syncer/syncer.go
View file @
b0d3bccb
...
@@ -15,8 +15,8 @@ import (
...
@@ -15,8 +15,8 @@ import (
"github.com/meshplus/bitxhub-kit/types"
"github.com/meshplus/bitxhub-kit/types"
"github.com/sirupsen/logrus"
"github.com/sirupsen/logrus"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
var
_
Syncer
=
(
*
WrapperSyncer
)(
nil
)
var
_
Syncer
=
(
*
WrapperSyncer
)(
nil
)
...
...
internal/syncer/syncer_test.go
View file @
b0d3bccb
...
@@ -22,12 +22,12 @@ import (
...
@@ -22,12 +22,12 @@ import (
"github.com/meshplus/bitxhub-kit/types"
"github.com/meshplus/bitxhub-kit/types"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/hub/client/mock_client"
"git
lab.33.cn
/link33/sidecar/hub/client/mock_client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
"git
hub.com
/link33/sidecar/pkg/log"
"git
lab.33.cn
/link33/sidecar/pkg/log"
)
)
const
(
const
(
...
...
internal/txcrypto/cryptor.go
View file @
b0d3bccb
...
@@ -9,9 +9,9 @@ import (
...
@@ -9,9 +9,9 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/ecdh"
"github.com/meshplus/bitxhub-kit/crypto/ecdh"
"github.com/meshplus/bitxhub-kit/crypto/sym"
"github.com/meshplus/bitxhub-kit/crypto/sym"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/constant"
"git
lab.33.cn
/link33/sidecar/model/constant"
)
)
type
cryptor
struct
{
type
cryptor
struct
{
...
...
internal/txcrypto/txcrypto_test.go
View file @
b0d3bccb
...
@@ -10,10 +10,10 @@ import (
...
@@ -10,10 +10,10 @@ import (
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/meshplus/bitxhub-kit/crypto/asym"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/require"
rpcx
"git
hub.com
/link33/sidecar/hub/client"
rpcx
"git
lab.33.cn
/link33/sidecar/hub/client"
"git
hub.com
/link33/sidecar/hub/client/mock_client"
"git
lab.33.cn
/link33/sidecar/hub/client/mock_client"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
func
TestRelayCryptor
(
t
*
testing
.
T
)
{
func
TestRelayCryptor
(
t
*
testing
.
T
)
{
...
...
pkg/plugins/grpc.go
View file @
b0d3bccb
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"github.com/Rican7/retry"
"github.com/Rican7/retry"
"github.com/Rican7/retry/strategy"
"github.com/Rican7/retry/strategy"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// 实现 AppchainPluginServer接口,具体逻辑委托给业务接口Client的实现。主要是给插件进程使用。
// 实现 AppchainPluginServer接口,具体逻辑委托给业务接口Client的实现。主要是给插件进程使用。
...
...
pkg/plugins/interface.go
View file @
b0d3bccb
package
plugins
package
plugins
import
(
import
(
"git
hub.com
/link33/sidecar/internal"
"git
lab.33.cn
/link33/sidecar/internal"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
//go:generate mockgen -destination mock_client/mock_client.go -package mock_client -source interface.go
//go:generate mockgen -destination mock_client/mock_client.go -package mock_client -source interface.go
...
...
pkg/plugins/mock_client/mock_client.go
View file @
b0d3bccb
...
@@ -8,8 +8,8 @@ import (
...
@@ -8,8 +8,8 @@ import (
reflect
"reflect"
reflect
"reflect"
gomock
"github.com/golang/mock/gomock"
gomock
"github.com/golang/mock/gomock"
pb
"git
hub.com
/link33/sidecar/model/pb"
pb
"git
lab.33.cn
/link33/sidecar/model/pb"
plugins
"git
hub.com
/link33/sidecar/pkg/plugins"
plugins
"git
lab.33.cn
/link33/sidecar/pkg/plugins"
)
)
// MockKernel is a mock of Kernel interface.
// MockKernel is a mock of Kernel interface.
...
...
pkg/plugins/plugin.go
View file @
b0d3bccb
...
@@ -6,7 +6,7 @@ import (
...
@@ -6,7 +6,7 @@ import (
plugin
"github.com/hashicorp/go-plugin"
plugin
"github.com/hashicorp/go-plugin"
"google.golang.org/grpc"
"google.golang.org/grpc"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
)
)
// Handshake is a common handshake that is shared by plugin and host.
// Handshake is a common handshake that is shared by plugin and host.
...
...
pkg/plugins/start.go
View file @
b0d3bccb
...
@@ -9,8 +9,8 @@ import (
...
@@ -9,8 +9,8 @@ import (
hclog
"github.com/hashicorp/go-hclog"
hclog
"github.com/hashicorp/go-hclog"
plugin
"github.com/hashicorp/go-plugin"
plugin
"github.com/hashicorp/go-plugin"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/tool"
"git
lab.33.cn
/link33/sidecar/tool"
)
)
var
logger
=
hclog
.
New
(
&
hclog
.
LoggerOptions
{
var
logger
=
hclog
.
New
(
&
hclog
.
LoggerOptions
{
...
...
pkg/plugins/test/plugin_test.go
View file @
b0d3bccb
...
@@ -11,10 +11,10 @@ import (
...
@@ -11,10 +11,10 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/metadata"
"git
hub.com
/link33/sidecar/internal/repo"
"git
lab.33.cn
/link33/sidecar/internal/repo"
"git
hub.com
/link33/sidecar/model/pb"
"git
lab.33.cn
/link33/sidecar/model/pb"
"git
hub.com
/link33/sidecar/pkg/plugins"
"git
lab.33.cn
/link33/sidecar/pkg/plugins"
"git
hub.com
/link33/sidecar/pkg/plugins/mock_client"
"git
lab.33.cn
/link33/sidecar/pkg/plugins/mock_client"
)
)
const
(
const
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment