move config and api modules to individual repo

This commit is contained in:
ginuerzh
2022-03-14 21:34:55 +08:00
parent 695c720d26
commit 749d802a12
25 changed files with 62 additions and 3673 deletions

View File

@ -9,9 +9,8 @@ import (
"strings"
"time"
"github.com/go-gost/gost/v3/pkg/config"
"github.com/go-gost/config"
"github.com/go-gost/gost/v3/pkg/metadata"
metrics "github.com/go-gost/gost/v3/pkg/metrics/service"
"github.com/go-gost/gost/v3/pkg/registry"
)
@ -35,15 +34,14 @@ func buildConfigFromCmd(services, nodes stringList) (*config.Config, error) {
if v := os.Getenv("GOST_PROFILING"); v != "" {
cfg.Profiling = &config.ProfilingConfig{
Addr: v,
Enable: true,
Addr: v,
}
}
if v := os.Getenv("GOST_METRICS"); v != "" {
cfg.Metrics = &config.MetricsConfig{
Enable: true,
Addr: v,
Path: metrics.DefaultPath,
}
}
@ -53,6 +51,12 @@ func buildConfigFromCmd(services, nodes stringList) (*config.Config, error) {
}
}
if v := os.Getenv("GOST_API"); v != "" {
cfg.API = &config.APIConfig{
Addr: v,
}
}
var chain *config.ChainConfig
if len(nodes) > 0 {
chain = &config.ChainConfig{

View File

@ -4,9 +4,9 @@ import (
"io"
"os"
"github.com/go-gost/gost/v3/pkg/api"
"github.com/go-gost/gost/v3/pkg/config"
"github.com/go-gost/gost/v3/pkg/config/parsing"
"github.com/go-gost/api"
"github.com/go-gost/config"
"github.com/go-gost/config/parsing"
"github.com/go-gost/gost/v3/pkg/logger"
metrics "github.com/go-gost/gost/v3/pkg/metrics/service"
"github.com/go-gost/gost/v3/pkg/registry"

View File

@ -8,7 +8,7 @@ import (
"os"
"runtime"
"github.com/go-gost/gost/v3/pkg/config"
"github.com/go-gost/config"
"github.com/go-gost/gost/v3/pkg/logger"
"github.com/go-gost/gost/v3/pkg/metrics"
)

View File

@ -10,8 +10,8 @@ import (
"math/big"
"time"
"github.com/go-gost/config"
tls_util "github.com/go-gost/gost/v3/pkg/common/util/tls"
"github.com/go-gost/gost/v3/pkg/config"
)
func buildDefaultTLSConfig(cfg *config.TLSConfig) {