File tree Expand file tree Collapse file tree 3 files changed +1
-20
lines changed
Expand file tree Collapse file tree 3 files changed +1
-20
lines changed Original file line number Diff line number Diff line change 55 "sync"
66
77 "github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction"
8- "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/tftp"
98 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/presentation"
109 "github.com/rs/zerolog"
1110)
@@ -36,12 +35,6 @@ func (transport *Transport) WithEncoder(encoder *presentation.Encoder) *Transpor
3635 return transport
3736}
3837
39- func (transport * Transport ) WithTFTP (client * tftp.Client ) * Transport {
40- transport .tftp = client
41- transport .logger .Trace ().Msg ("set TFTP" )
42- return transport
43- }
44-
4538func (transport * Transport ) SetIdTarget (id abstraction.PacketId , target abstraction.TransportTarget ) * Transport {
4639 transport .idToTarget [id ] = target
4740 transport .logger .Trace ().Uint16 ("id" , uint16 (id )).Str ("target" , string (target )).Msg ("set id for target" )
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ import (
1212 "github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction"
1313 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network"
1414 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/tcp"
15- "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/tftp"
1615 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/udp"
1716 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/packet/data"
1817 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/presentation"
18+ "github.com/pin/tftp/v3"
1919 "github.com/rs/zerolog"
2020)
2121
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import (
1515 "github.com/HyperloopUPV-H8/h9-backend/pkg/abstraction"
1616 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network"
1717 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/tcp"
18- "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/tftp"
1918 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/network/udp"
2019 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/packet/data"
2120 "github.com/HyperloopUPV-H8/h9-backend/pkg/transport/presentation"
@@ -372,17 +371,6 @@ func TestTransport_SetTargetIp(t *testing.T) {
372371 }
373372}
374373
375- func TestWithTFTP (t * testing.T ) {
376- tr := NewTransport (defaultLogger ())
377- tr .SetAPI (noopTransportAPI {})
378- client := & tftp.Client {}
379-
380- out := tr .WithTFTP (client )
381- if out .tftp != client {
382- t .Fatalf ("expected tftp client to be set" )
383- }
384- }
385-
386374func TestTransportErrors (t * testing.T ) {
387375 tests := []struct {
388376 err error
You can’t perform that action at this time.
0 commit comments