diff --git a/transports/Replicant/v3/Optimizer.go b/transports/Replicant/v3/Optimizer.go index c7e28b7..c51db1d 100644 --- a/transports/Replicant/v3/Optimizer.go +++ b/transports/Replicant/v3/Optimizer.go @@ -26,7 +26,6 @@ package replicant import ( pt "github.com/OperatorFoundation/shapeshifter-ipc/v2" - "github.com/kataras/golog" "golang.org/x/net/proxy" "net" ) @@ -36,31 +35,27 @@ type TransportClient struct { Config ClientConfig Address string Dialer proxy.Dialer - Log *golog.Logger } type TransportServer struct { - Config ServerConfig + Config ServerConfig Address string Dialer proxy.Dialer - Log *golog.Logger } -func NewClient(config ClientConfig, address string, dialer proxy.Dialer, log *golog.Logger) TransportClient { +func NewClient(config ClientConfig, dialer proxy.Dialer) TransportClient { return TransportClient{ - Config: config, - Address: address, - Dialer: dialer, - Log: log, + Config: config, + Address: config.Address, + Dialer: dialer, } } -func NewServer(config ServerConfig, address string, dialer proxy.Dialer, log *golog.Logger) TransportServer { +func NewServer(config ServerConfig, address string, dialer proxy.Dialer) TransportServer { return TransportServer{ - Config: config, + Config: config, Address: address, - Dialer: dialer, - Log: log, + Dialer: dialer, } } @@ -78,7 +73,7 @@ func (transport TransportClient) Dial() (net.Conn, error) { } return transportConn, nil - } +} func (transport TransportServer) Listen() (net.Listener, error) { addr, resolveErr := pt.ResolveAddr(transport.Address) @@ -93,14 +88,13 @@ func (transport TransportServer) Listen() (net.Listener, error) { return newReplicantTransportListener(ln, transport.Config), nil } - //replicantTransport := New(transport.Config, transport.Dialer) - //conn := replicantTransport.Dial(transport.Address) - //conn, err:= replicantTransport.Dial(transport.Address), errors.New("connection failed") - //if err != nil { - // return nil, err - //} else { - // return conn, nil - //} - //return conn, nil - +//replicantTransport := New(transport.Config, transport.Dialer) +//conn := replicantTransport.Dial(transport.Address) +//conn, err:= replicantTransport.Dial(transport.Address), errors.New("connection failed") +//if err != nil { +// return nil, err +//} else { +// return conn, nil +//} +//return conn, nil diff --git a/transports/Replicant/v3/config.go b/transports/Replicant/v3/config.go index 092fba1..37426ce 100644 --- a/transports/Replicant/v3/config.go +++ b/transports/Replicant/v3/config.go @@ -33,6 +33,7 @@ import ( type ClientConfig struct { Toneburst toneburst.Config Polish polish.ClientConfig + Address string } type ServerConfig struct { @@ -70,6 +71,7 @@ func (config ClientConfig) Marshal() (string, error) { type ClientJSONConfig struct { Config string `json:"config"` + Address string `json:"address"` } configString, configStringError := config.Encode() diff --git a/transports/Replicant/v3/go.mod b/transports/Replicant/v3/go.mod index 2d0d408..063ac28 100644 --- a/transports/Replicant/v3/go.mod +++ b/transports/Replicant/v3/go.mod @@ -5,6 +5,7 @@ go 1.12 require ( github.com/OperatorFoundation/monolith-go/monolith v1.0.4 github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0 + github.com/kataras/golog v0.0.18 github.com/opentracing/opentracing-go v1.1.0 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 golang.org/x/net v0.0.0-20200202094626-16171245cfb2 diff --git a/transports/Replicant/v3/go.sum b/transports/Replicant/v3/go.sum index 3382e0b..8d20f0d 100644 --- a/transports/Replicant/v3/go.sum +++ b/transports/Replicant/v3/go.sum @@ -4,8 +4,10 @@ github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0 h1:6aQs+TF3KULMarpzbKu8 github.com/OperatorFoundation/shapeshifter-ipc/v2 v2.0.0/go.mod h1:gb/QiZH0QDXLSQ9PskyJ2oTflB7tsP4AYc8y+FppvB0= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= - h1:lDH9UUVJtmYCjyT0CI4q8xvlXPxeZ0gYCVvWbmPlp88= -/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/kataras/golog v0.0.18 h1:Td7hcKN25yzqB/0SO5iohOsMk5Mq5V9kDtM5apaJLY0= +github.com/kataras/golog v0.0.18/go.mod h1:jRYl7dFYqP8aQj9VkwdBUXYZSfUktm+YYg1arJILfyw= +github.com/kataras/pio v0.0.8 h1:6pX6nHJk7DAV3x1dEimibQF2CmJLlo0jWVmM9yE9KY8= +github.com/kataras/pio v0.0.8/go.mod h1:NFfMp2kVP1rmV4N6gH6qgWpuoDKlrOeYi3VrAIWCGsE= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=