-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skywire-cli vpn
subcommands + separate-systray
#1317
Changes from 5 commits
8dde57a
405d731
0f83f14
b202365
70dfbb6
c7bbb0e
498aa61
a2b1a5c
8ddf64d
ab9bf63
37b22e1
f5d0e06
73d4dbf
d5e68d6
67bb78c
b42e900
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,17 @@ | ||
package clihv | ||
|
||
import ( | ||
"net" | ||
"time" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/skycoin/skywire-utilities/pkg/logging" | ||
"github.com/skycoin/skywire/pkg/visor" | ||
) | ||
|
||
var ( | ||
logger = logging.MustGetLogger("skywire-cli") | ||
rpcAddr string | ||
path string | ||
pk string | ||
url string | ||
pkg bool | ||
logger = logging.MustGetLogger("skywire-cli") | ||
) | ||
|
||
// RootCmd contains commands that interact with the skywire-visor | ||
var RootCmd = &cobra.Command{ | ||
Use: "hv", | ||
Short: "Open HVUI in browser", | ||
} | ||
|
||
func rpcClient() visor.API { | ||
const rpcDialTimeout = time.Second * 5 | ||
conn, err := net.DialTimeout("tcp", rpcAddr, rpcDialTimeout) | ||
if err != nil { | ||
logger.Fatal("RPC connection failed; is skywire running?\n", err) | ||
} | ||
return visor.NewRPCClient(logger, conn, visor.RPCPrefix, 0) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package clirpc | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Package may as well just be called |
||
|
||
import ( | ||
"net" | ||
"time" | ||
|
||
"github.com/skycoin/skywire-utilities/pkg/logging" | ||
"github.com/skycoin/skywire/pkg/visor" | ||
) | ||
|
||
var ( | ||
// RPCAddr is the address to reach the rpc server | ||
RPCAddr string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this set via the persistent flag in the parent dir or where is this coming from? Does it need to be exported? |
||
logger = logging.MustGetLogger("skywire-cli") | ||
) | ||
|
||
// RPCClient is used by the other cli commands to query the visor rpc | ||
func RPCClient() visor.API { | ||
const rpcDialTimeout = time.Second * 5 | ||
conn, err := net.DialTimeout("tcp", RPCAddr, rpcDialTimeout) | ||
if err != nil { | ||
logger.Fatal("RPC connection failed; is skywire running?\n", err) | ||
} | ||
return visor.NewRPCClient(logger, conn, visor.RPCPrefix, 0) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these variables seem unsued.