OSDN Git Service

rename dir (#283)
[bytom/vapor.git] / toolbar / federation / config / config.go
similarity index 75%
rename from federation/config/config.go
rename to toolbar/federation/config/config.go
index d05082b..5cf4edd 100644 (file)
@@ -7,6 +7,7 @@ import (
        log "github.com/sirupsen/logrus"
 
        vaporJson "github.com/vapor/encoding/json"
+       "github.com/vapor/toolbar/common"
 )
 
 func NewConfig() *Config {
@@ -34,7 +35,7 @@ func NewConfigWithPath(path string) *Config {
 
 type Config struct {
        API            API                `json:"api"`
-       MySQLConfig    MySQLConfig        `json:"mysql"`
+       MySQLConfig    common.MySQLConfig `json:"mysql"`
        FederationProg vaporJson.HexBytes `json:"federation_prog"`
        Mainchain      Chain              `json:"mainchain"`
        Sidechain      Chain              `json:"sidechain"`
@@ -44,19 +45,6 @@ type API struct {
        IsReleaseMode bool `json:"is_release_mode"`
 }
 
-type MySQLConfig struct {
-       Connection MySQLConnection `json:"connection"`
-       LogMode    bool            `json:"log_mode"`
-}
-
-type MySQLConnection struct {
-       Host     string `json:"host"`
-       Port     uint   `json:"port"`
-       Username string `json:"username"`
-       Password string `json:"password"`
-       DbName   string `json:"database"`
-}
-
 type Chain struct {
        Name          string `json:"name"`
        Upstream      string `json:"upstream"`