File tree 3 files changed +8
-1
lines changed
3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ go 1.21.1
4
4
5
5
require (
6
6
github.com/schollz/progressbar/v3 v3.14.1
7
+ github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
7
8
github.com/urfave/cli/v2 v2.25.7
8
9
)
9
10
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
15
15
github.com/russross/blackfriday/v2 v2.1.0 /go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM =
16
16
github.com/schollz/progressbar/v3 v3.14.1 h1:VD+MJPCr4s3wdhTc7OEJ/Z3dAeBzJ7yKH/P4lC5yRTI =
17
17
github.com/schollz/progressbar/v3 v3.14.1 /go.mod h1:Zc9xXneTzWXF81TGoqL71u0sBPjULtEHYtj/WVgVy8E =
18
+ github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0 =
19
+ github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e /go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M =
18
20
github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
19
21
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q =
20
22
github.com/stretchr/testify v1.3.0 /go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI =
Original file line number Diff line number Diff line change 9
9
"github.com/chyok/st/internal/pkg/discovery"
10
10
"github.com/chyok/st/internal/pkg/transfer"
11
11
"github.com/chyok/st/template"
12
+ "github.com/skip2/go-qrcode"
12
13
13
14
"github.com/urfave/cli/v2"
14
15
)
@@ -24,7 +25,10 @@ func sendFile(c *cli.Context) error {
24
25
}
25
26
26
27
func receiveFile (c * cli.Context ) error {
27
- fmt .Println ("server address: http://" + config .G .LocalIP + ":" + config .G .Port )
28
+ address := fmt .Sprintf ("http://%s:%s" , config .G .LocalIP , config .G .Port )
29
+ q , _ := qrcode .New (address , qrcode .Low )
30
+ fmt .Println (q .ToSmallString (false ))
31
+ fmt .Printf ("Server address: %s \n " , address )
28
32
fmt .Println ("Waiting transfer..." )
29
33
go discovery .Listen (config .G .MulticastAddress )
30
34
http .HandleFunc ("/" , transfer .ReceiveFileHandler )
You can’t perform that action at this time.
0 commit comments