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
e30d8e60
Commit
e30d8e60
authored
Nov 24, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename manger to manager package
parent
88993240
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
sidecar.go
internal/app/sidecar.go
+3
-3
logger_test.go
internal/loggers/logger_test.go
+2
-2
loggers.go
internal/loggers/loggers.go
+3
-3
manager.go
internal/manager/manager.go
+1
-1
persister.go
internal/manager/persister.go
+1
-1
config.go
internal/repo/config.go
+1
-1
No files found.
internal/app/sidecar.go
View file @
e30d8e60
...
@@ -15,7 +15,7 @@ import (
...
@@ -15,7 +15,7 @@ import (
"gitlab.33.cn/link33/sidecar/internal"
"gitlab.33.cn/link33/sidecar/internal"
"gitlab.33.cn/link33/sidecar/internal/appchain"
"gitlab.33.cn/link33/sidecar/internal/appchain"
"gitlab.33.cn/link33/sidecar/internal/loggers"
"gitlab.33.cn/link33/sidecar/internal/loggers"
"gitlab.33.cn/link33/sidecar/internal/manger"
"gitlab.33.cn/link33/sidecar/internal/man
a
ger"
"gitlab.33.cn/link33/sidecar/internal/peermgr"
"gitlab.33.cn/link33/sidecar/internal/peermgr"
"gitlab.33.cn/link33/sidecar/internal/repo"
"gitlab.33.cn/link33/sidecar/internal/repo"
"gitlab.33.cn/link33/sidecar/internal/router"
"gitlab.33.cn/link33/sidecar/internal/router"
...
@@ -59,7 +59,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error)
...
@@ -59,7 +59,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error)
pm
,
err
:=
peermgr
.
New
(
config
,
r
,
nodePrivKey
,
privateKey
,
1
,
loggers
.
Logger
(
loggers
.
PeerMgr
))
pm
,
err
:=
peermgr
.
New
(
config
,
r
,
nodePrivKey
,
privateKey
,
1
,
loggers
.
Logger
(
loggers
.
PeerMgr
))
tool
.
Asset
(
err
)
tool
.
Asset
(
err
)
clients
:=
plugins
.
CreateClients
(
config
.
Appchains
,
nil
)
clients
:=
plugins
.
CreateClients
(
config
.
Appchains
,
nil
)
persister
:=
man
ger
.
NewPersister
(
addr
.
String
(),
store
,
loggers
.
Logger
(
loggers
.
Man
ger
))
persister
:=
man
ager
.
NewPersister
(
addr
.
String
(),
store
,
loggers
.
Logger
(
loggers
.
Mana
ger
))
appchainMgr
:=
appchainmgr
.
New
(
persister
)
appchainMgr
:=
appchainmgr
.
New
(
persister
)
// TODO hub client
// TODO hub client
// privateKey DH
// privateKey DH
...
@@ -68,7 +68,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error)
...
@@ -68,7 +68,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error)
r
.
Adds
(
clientPort
)
r
.
Adds
(
clientPort
)
rule
,
err
:=
rulemgr
.
New
(
store
,
loggers
.
Logger
(
loggers
.
Rule
))
rule
,
err
:=
rulemgr
.
New
(
store
,
loggers
.
Logger
(
loggers
.
Rule
))
tool
.
Asset
(
err
)
tool
.
Asset
(
err
)
mg
,
err
:=
man
ger
.
NewManager
(
addr
.
String
(),
pm
,
appchainMgr
,
rule
,
loggers
.
Logger
(
loggers
.
Man
ger
))
mg
,
err
:=
man
ager
.
NewManager
(
addr
.
String
(),
pm
,
appchainMgr
,
rule
,
loggers
.
Logger
(
loggers
.
Mana
ger
))
tool
.
Asset
(
err
)
tool
.
Asset
(
err
)
apiServer
:=
api
.
NewServer
(
config
,
r
,
loggers
.
Logger
(
loggers
.
ApiServer
))
apiServer
:=
api
.
NewServer
(
config
,
r
,
loggers
.
Logger
(
loggers
.
ApiServer
))
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
...
...
internal/loggers/logger_test.go
View file @
e30d8e60
...
@@ -34,7 +34,7 @@ func TestLogger(t *testing.T) {
...
@@ -34,7 +34,7 @@ func TestLogger(t *testing.T) {
api
:=
Logger
(
ApiServer
)
// TODO
api
:=
Logger
(
ApiServer
)
// TODO
require
.
NotNil
(
t
,
api
)
require
.
NotNil
(
t
,
api
)
// api.Info("-------")
// api.Info("-------")
// mangerLoggerLevel := w.loggers[Manger].Logger.Level.String()
// mangerLoggerLevel := w.loggers[Man
a
ger].Logger.Level.String()
// t.Log(mangerLoggerLevel)
// t.Log(mangerLoggerLevel)
// require.Equal(t, config.Log.Module.Manger, mangerLoggerLevel)
// require.Equal(t, config.Log.Module.Man
a
ger, mangerLoggerLevel)
}
}
internal/loggers/loggers.go
View file @
e30d8e60
...
@@ -18,7 +18,7 @@ const (
...
@@ -18,7 +18,7 @@ const (
Router
=
"router"
Router
=
"router"
Swarm
=
"swarm"
Swarm
=
"swarm"
Syncer
=
"syncer"
Syncer
=
"syncer"
Man
ger
=
"man
ger"
Man
ager
=
"mana
ger"
Rule
=
"rule"
Rule
=
"rule"
)
)
...
@@ -50,8 +50,8 @@ func InitializeLogger(config *repo.Config) {
...
@@ -50,8 +50,8 @@ func InitializeLogger(config *repo.Config) {
m
[
Syncer
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Syncer
))
m
[
Syncer
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Syncer
))
m
[
PeerMgr
]
=
log
.
NewWithModule
(
PeerMgr
)
m
[
PeerMgr
]
=
log
.
NewWithModule
(
PeerMgr
)
m
[
PeerMgr
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
PeerMgr
))
m
[
PeerMgr
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
PeerMgr
))
m
[
Man
ger
]
=
log
.
NewWithModule
(
Man
ger
)
m
[
Man
ager
]
=
log
.
NewWithModule
(
Mana
ger
)
m
[
Manger
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Manger
))
m
[
Man
a
ger
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Manger
))
m
[
Rule
]
=
log
.
NewWithModule
(
Rule
)
m
[
Rule
]
=
log
.
NewWithModule
(
Rule
)
m
[
Rule
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Rule
))
m
[
Rule
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Rule
))
w
=
&
loggerWrapper
{
loggers
:
m
}
w
=
&
loggerWrapper
{
loggers
:
m
}
...
...
internal/manger/manager.go
→
internal/man
a
ger/manager.go
View file @
e30d8e60
package
manger
package
man
a
ger
import
(
import
(
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
...
...
internal/manger/persister.go
→
internal/man
a
ger/persister.go
View file @
e30d8e60
package
manger
package
man
a
ger
import
(
import
(
"github.com/meshplus/bitxhub-core/governance"
"github.com/meshplus/bitxhub-core/governance"
...
...
internal/repo/config.go
View file @
e30d8e60
...
@@ -66,7 +66,7 @@ type LogModule struct {
...
@@ -66,7 +66,7 @@ type LogModule struct {
Router
string
`toml:"router" json:"router" json:"router,omitempty"`
Router
string
`toml:"router" json:"router" json:"router,omitempty"`
Swarm
string
`toml:"swarm" json:"swarm" json:"swarm,omitempty"`
Swarm
string
`toml:"swarm" json:"swarm" json:"swarm,omitempty"`
Syncer
string
`toml:"syncer" json:"syncer" json:"syncer,omitempty"`
Syncer
string
`toml:"syncer" json:"syncer" json:"syncer,omitempty"`
Manger
string
`toml:"man
ger" json:"manger" json:"man
ger,omitempty"`
Manger
string
`toml:"man
ager" json:"manager" json:"mana
ger,omitempty"`
Rule
string
`toml:"rule" json:"rule" json:"rule,omitempty"`
Rule
string
`toml:"rule" json:"rule" json:"rule,omitempty"`
}
}
...
...
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