mirror of
https://github.com/openziti/zrok.git
synced 2026-08-24 10:14:56 -05:00
lint (#1010)
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/openziti/sdk-golang/ziti/edge"
|
||||
"github.com/openziti/zrok/drives/davServer"
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type BackendConfig struct {
|
||||
@@ -37,9 +37,7 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
||||
return nil, errors.Wrap(err, "error loading ziti identity")
|
||||
}
|
||||
if cfg.SuperNetwork {
|
||||
zcfg.MaxDefaultConnections = 2
|
||||
zcfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zcfg)
|
||||
}
|
||||
zctx, err := ziti.NewContext(zcfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -41,9 +41,7 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
||||
return nil, errors.Wrap(err, "error loading config")
|
||||
}
|
||||
if cfg.SuperNetwork {
|
||||
zcfg.MaxDefaultConnections = 2
|
||||
zcfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zcfg)
|
||||
}
|
||||
zctx, err := ziti.NewContext(zcfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -59,22 +59,13 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
|
||||
}
|
||||
zCfg.ConfigTypes = []string{sdk.ZrokProxyConfig}
|
||||
if cfg.SuperNetwork {
|
||||
zCfg.MaxDefaultConnections = 2
|
||||
zCfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zCfg)
|
||||
}
|
||||
zCtx, err := ziti.NewContext(zCfg)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "error loading ziti context")
|
||||
}
|
||||
zDialCtx := zitiDialContext{ctx: zCtx, shrToken: cfg.ShrToken}
|
||||
if env.Config() != nil {
|
||||
if env.Config().SuperNetwork {
|
||||
zCfg.MaxDefaultConnections = 2
|
||||
zCfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
}
|
||||
}
|
||||
zTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
zTransport.DialContext = zDialCtx.Dial
|
||||
|
||||
|
||||
@@ -66,9 +66,7 @@ func NewHTTP(cfg *Config) (*HttpFrontend, error) {
|
||||
zDialCtx := zitiDialContext{ctx: zCtx}
|
||||
superNetwork, _ := root.SuperNetwork()
|
||||
if superNetwork {
|
||||
zCfg.MaxDefaultConnections = 2
|
||||
zCfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zCfg)
|
||||
}
|
||||
zTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||
zTransport.DialContext = zDialCtx.Dial
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/openziti/sdk-golang/ziti"
|
||||
"github.com/openziti/sdk-golang/ziti/edge"
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type BackendConfig struct {
|
||||
@@ -33,9 +33,7 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
||||
return nil, errors.Wrap(err, "error loading ziti identity")
|
||||
}
|
||||
if cfg.SuperNetwork {
|
||||
zcfg.MaxDefaultConnections = 2
|
||||
zcfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zcfg)
|
||||
}
|
||||
zctx, err := ziti.NewContext(zcfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/openziti/sdk-golang/ziti"
|
||||
"github.com/openziti/sdk-golang/ziti/edge"
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -34,9 +35,7 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
||||
return nil, errors.Wrap(err, "error loading config")
|
||||
}
|
||||
if cfg.SuperNetwork {
|
||||
zcfg.MaxDefaultConnections = 2
|
||||
zcfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zcfg)
|
||||
}
|
||||
zctx, err := ziti.NewContext(zcfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/environment"
|
||||
"github.com/openziti/zrok/sdk/golang/sdk"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -46,9 +47,7 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
|
||||
zCfg.ConfigTypes = []string{sdk.ZrokProxyConfig}
|
||||
superNetwork, _ := env.SuperNetwork()
|
||||
if superNetwork {
|
||||
zCfg.MaxDefaultConnections = 2
|
||||
zCfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zCfg)
|
||||
}
|
||||
zCtx, err := ziti.NewContext(zCfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/openziti/sdk-golang/ziti"
|
||||
"github.com/openziti/sdk-golang/ziti/edge"
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -34,9 +35,7 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
||||
return nil, errors.Wrap(err, "error loading config")
|
||||
}
|
||||
if cfg.SuperNetwork {
|
||||
zcfg.MaxDefaultConnections = 2
|
||||
zcfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zcfg)
|
||||
}
|
||||
zctx, err := ziti.NewContext(zcfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/environment"
|
||||
"github.com/openziti/zrok/sdk/golang/sdk"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -116,9 +117,7 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
|
||||
zCfg.ConfigTypes = []string{sdk.ZrokProxyConfig}
|
||||
superNetwork, _ := env.SuperNetwork()
|
||||
if superNetwork {
|
||||
zCfg.MaxDefaultConnections = 2
|
||||
zCfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zCfg)
|
||||
}
|
||||
zCtx, err := ziti.NewContext(zCfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/openziti/sdk-golang/ziti"
|
||||
"github.com/openziti/sdk-golang/ziti/edge"
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/util"
|
||||
cmap "github.com/orcaman/concurrent-map/v2"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -59,9 +60,7 @@ func NewBackend(cfg *BackendConfig) (*Backend, error) {
|
||||
return nil, errors.Wrap(err, "error loading config")
|
||||
}
|
||||
if cfg.SuperNetwork {
|
||||
zcfg.MaxDefaultConnections = 2
|
||||
zcfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zcfg)
|
||||
}
|
||||
zctx, err := ziti.NewContext(zcfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/openziti/zrok/endpoints"
|
||||
"github.com/openziti/zrok/environment"
|
||||
"github.com/openziti/zrok/sdk/golang/sdk"
|
||||
"github.com/openziti/zrok/util"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -44,9 +45,7 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
|
||||
zCfg.ConfigTypes = []string{sdk.ZrokProxyConfig}
|
||||
superNetwork, _ := env.SuperNetwork()
|
||||
if superNetwork {
|
||||
zCfg.MaxDefaultConnections = 2
|
||||
zCfg.MaxControlConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
util.EnableSuperNetwork(zCfg)
|
||||
}
|
||||
zCtx, err := ziti.NewContext(zCfg)
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"github.com/openziti/sdk-golang/ziti"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func EnableSuperNetwork(zCfg *ziti.Config) {
|
||||
zCfg.MaxControlConnections = 2
|
||||
zCfg.MaxDefaultConnections = 1
|
||||
logrus.Warnf("super networking enabled")
|
||||
}
|
||||
Reference in New Issue
Block a user