Commit e30d8e60 authored by suyanlong's avatar suyanlong

rename manger to manager package

parent 88993240
...@@ -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/manager"
"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 := manger.NewPersister(addr.String(), store, loggers.Logger(loggers.Manger)) persister := manager.NewPersister(addr.String(), store, loggers.Logger(loggers.Manager))
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 := manger.NewManager(addr.String(), pm, appchainMgr, rule, loggers.Logger(loggers.Manger)) mg, err := manager.NewManager(addr.String(), pm, appchainMgr, rule, loggers.Logger(loggers.Manager))
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())
......
...@@ -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[Manager].Logger.Level.String()
// t.Log(mangerLoggerLevel) // t.Log(mangerLoggerLevel)
// require.Equal(t, config.Log.Module.Manger, mangerLoggerLevel) // require.Equal(t, config.Log.Module.Manager, mangerLoggerLevel)
} }
...@@ -18,7 +18,7 @@ const ( ...@@ -18,7 +18,7 @@ const (
Router = "router" Router = "router"
Swarm = "swarm" Swarm = "swarm"
Syncer = "syncer" Syncer = "syncer"
Manger = "manger" Manager = "manager"
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[Manger] = log.NewWithModule(Manger) m[Manager] = log.NewWithModule(Manager)
m[Manger].Logger.SetLevel(log.ParseLevel(config.Log.Module.Manger)) m[Manager].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}
......
package manger package manager
import ( import (
appchainmgr "github.com/meshplus/bitxhub-core/appchain-mgr" appchainmgr "github.com/meshplus/bitxhub-core/appchain-mgr"
......
package manger package manager
import ( import (
"github.com/meshplus/bitxhub-core/governance" "github.com/meshplus/bitxhub-core/governance"
......
...@@ -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:"manger" json:"manger" json:"manger,omitempty"` Manger string `toml:"manager" json:"manager" json:"manager,omitempty"`
Rule string `toml:"rule" json:"rule" json:"rule,omitempty"` Rule string `toml:"rule" json:"rule" json:"rule,omitempty"`
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment