Skip to content

Commit

Permalink
replace dmsgget with dmsgcurl lib
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpalide committed Oct 18, 2023
1 parent 7025a97 commit 70726d3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions cmd/skywire-cli/commands/log/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/hashicorp/go-version"
"github.com/sirupsen/logrus"
"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"
"github.com/skycoin/dmsg/pkg/dmsghttp"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -61,8 +61,8 @@ func init() {
logCmd.Flags().Int64Var(&maxFileSize, "maxfilesize", 30, "maximum file size allowed to download during collecting logs, in KB")
logCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "D", skyenv.DmsgDiscAddr, "dmsg discovery url\n")
logCmd.Flags().StringVarP(&utAddr, "ut", "u", "", "custom uptime tracker url")
if os.Getenv("DMSGGET_SK") != "" {
sk.Set(os.Getenv("DMSGGET_SK")) //nolint
if os.Getenv("DMSGCURL_SK") != "" {
sk.Set(os.Getenv("DMSGCURL_SK")) //nolint
}
logCmd.Flags().VarP(&sk, "sk", "s", "a random key is generated if unspecified\n\r")
}
Expand Down Expand Up @@ -101,8 +101,8 @@ var logCmd = &cobra.Command{
return
}

// Create dmsgget instance
dg := dmsgget.New(flag.CommandLine)
// Create dmsgcurl instance
dg := dmsgcurl.New(flag.CommandLine)
flag.Parse()

// Set the uptime tracker to fetch data from
Expand Down
4 changes: 2 additions & 2 deletions internal/vpn/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"

"github.com/skycoin/skywire-utilities/pkg/cipher"
)
Expand Down Expand Up @@ -137,7 +137,7 @@ func ParseIP(addr string) (net.IP, bool, error) {
if addr == "" {
return nil, false, nil
}
var url dmsgget.URL
var url dmsgcurl.URL

// in case dmsghttp url is provided
err := url.Fill(addr)
Expand Down
4 changes: 2 additions & 2 deletions pkg/visor/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/skycoin/dmsg/pkg/direct"
dmsgdisc "github.com/skycoin/dmsg/pkg/disc"
"github.com/skycoin/dmsg/pkg/dmsg"
"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"
"github.com/skycoin/dmsg/pkg/dmsghttp"
"github.com/skycoin/systray"
"github.com/toqueteos/webbrowser"
Expand Down Expand Up @@ -314,7 +314,7 @@ func getAvailPublicVPNServers(conf *visorconfig.V1, httpC *http.Client, logger *
}

func getSystrayHTTPClient(ctx context.Context, conf *visorconfig.V1, logger *logging.MasterLogger) *http.Client {
var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
serviceURL.Fill(conf.Launcher.ServiceDisc) //nolint
if serviceURL.Scheme == "dmsg" {
var keys cipher.PubKeys
Expand Down
8 changes: 4 additions & 4 deletions pkg/visor/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
dmsgdisc "github.com/skycoin/dmsg/pkg/disc"
"github.com/skycoin/dmsg/pkg/dmsg"
"github.com/skycoin/dmsg/pkg/dmsgctrl"
"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"
"github.com/skycoin/dmsg/pkg/dmsghttp"
"github.com/skycoin/dmsg/pkg/dmsgpty"

Expand Down Expand Up @@ -469,7 +469,7 @@ func initDmsgTrackers(ctx context.Context, v *Visor, _ *logging.Logger) error {

func initSudphClient(ctx context.Context, v *Visor, log *logging.Logger) error {

var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
_ = serviceURL.Fill(v.conf.Transport.AddressResolver) //nolint:errcheck
// don't start sudph if we are connection to AR via dmsghttp
if serviceURL.Scheme == "dmsg" {
Expand Down Expand Up @@ -1588,7 +1588,7 @@ func getErrors(ctx context.Context) chan error {

func getHTTPClient(ctx context.Context, v *Visor, service string) (*http.Client, error) {

var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
var delegatedServers []cipher.PubKey
err := serviceURL.Fill(service)

Expand Down Expand Up @@ -1628,7 +1628,7 @@ func getHTTPClient(ctx context.Context, v *Visor, service string) (*http.Client,
}

func getPublicIP(v *Visor, service string) (string, error) {
var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
var pIP string
err := serviceURL.Fill(service)
// only get the IP if the url is of dmsg
Expand Down

0 comments on commit 70726d3

Please sign in to comment.