Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
go-version: '1.26.x'
cache: true
cache-dependency-path: go.sum

- uses: golangci/golangci-lint-action@v7
with:
version: v2.6.1
version: v2.11.4

- name: Checking Format and Testing
run: make check
Expand Down Expand Up @@ -47,13 +47,13 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
go-version: '1.26.x'
cache: true
cache-dependency-path: go.sum

- uses: golangci/golangci-lint-action@v7
with:
version: v2.6.1
version: v2.11.4

- name: Checking Format and Testing
run: make check
Expand All @@ -68,7 +68,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.25.x'
go-version: '1.26.x'
cache: true
cache-dependency-path: go.sum

Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ check-windows: lint test-windows ## Run linters and tests on windows

lint: ## Run linters. Use make install-linters first
golangci-lint version
${OPTS} golangci-lint run -c .golangci.yml ./cmd/...
${OPTS} golangci-lint run -c .golangci.yml ./pkg/...
${OPTS} golangci-lint run -c .golangci.yml ./internal/...
${OPTS} golangci-lint run -c .golangci.yml ./...
${OPTS} golangci-lint run -c .golangci.yml .

vendorcheck: ## Run vendorcheck
GO111MODULE=off vendorcheck ./...
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The connection between a `dmsg.Client` and `dmsg.Server` is called a `dmsg.Sessi
made with [goda](https://github.com/loov/goda)

```
goda graph github.com/skycoin/dmsg/... | dot -Tsvg -o docs/dmsg-goda-graph.svg
go run github.com/loov/goda@latest graph github.com/skycoin/dmsg/... | dot -Tsvg -o docs/dmsg-goda-graph.svg
```

![Dependency Graph](docs/dmsg-goda-graph.svg "github.com/skycoin/dmsg Dependency Graph")
5 changes: 2 additions & 3 deletions cmd/conf/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/spf13/cobra"

"github.com/skycoin/dmsg/pkg/dmsg"
"github.com/skycoin/dmsg/pkg/dmsgclient"
)

// RootCmd is the root command
Expand All @@ -28,7 +29,5 @@ var RootCmd = &cobra.Command{

// Execute executes root CLI command.
func Execute() {
if err := RootCmd.Execute(); err != nil {
log.Fatal("Failed to execute command: ", err)
}
dmsgclient.Execute(RootCmd)
}
24 changes: 8 additions & 16 deletions cmd/dial/commands/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ package commands
import (
"context"
"fmt"
"log"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"time"
Expand All @@ -20,10 +17,9 @@ import (
"github.com/skycoin/skywire/pkg/skywire-utilities/pkg/logging"
"github.com/spf13/cobra"

"github.com/skycoin/dmsg/internal/cli"
"github.com/skycoin/dmsg/internal/flags"
"github.com/skycoin/dmsg/pkg/disc"
"github.com/skycoin/dmsg/pkg/dmsg"
"github.com/skycoin/dmsg/pkg/dmsgclient"
)

var (
Expand All @@ -35,17 +31,15 @@ var (
)

func init() {
flags.InitFlags(RootCmd)
dmsgclient.InitFlags(RootCmd)
RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "[ debug | warn | error | fatal | panic | trace | info ]\033[0m\n\r")
RootCmd.Flags().IntVarP(&waitTime, "wait", "w", 0, "wait time in seconds before disconnecting\n\r\033[0m")
RootCmd.Flags().VarP(&sk, "sk", "s", "a random key is generated if unspecified\n\r\033[0m")
}

// RootCmd contains the root dmsgcurl command
var RootCmd = &cobra.Command{
Use: func() string {
return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0]
}(),
Use: dmsgclient.ExecName(),
Short: "DMSG Dial network test utility",
Long: calvin.AsciiFont("dmsgdial") + `
DMSG Dial network test utility
Expand Down Expand Up @@ -126,15 +120,15 @@ Default mode of operation is dmsghttp:
defer cancel()

var dmsgClients []*dmsg.Client
if flags.UseDC {
if dmsgclient.UseDC {
dlog.Debug("Starting DMSG direct clients.")
for _, server := range dmsg.Prod.DmsgServers {
if len(dmsgClients) >= flags.DmsgSessions {
if len(dmsgClients) >= dmsgclient.DmsgSessions {
break
}
dest := dpk.String()

dmsgDC, closeFn, err := cli.StartDmsgDirectWithServers(ctx, dlog, pk, sk, "", []*disc.Entry{&server}, flags.DmsgSessions, dest)
dmsgDC, closeFn, err := dmsgclient.StartDmsgDirectWithServers(ctx, dlog, pk, sk, "", []*disc.Entry{&server}, dmsgclient.DmsgSessions, dest)
if err != nil {
dlog.WithError(err).Error("Failed to start DMSG direct client. Skipping server...")
continue
Expand All @@ -144,7 +138,7 @@ Default mode of operation is dmsghttp:
dmsgClients = append(dmsgClients, dmsgDC)
}
} else {
dmsgC, closeDmsg, err := cli.InitDmsgWithFlags(ctx, dlog, pk, sk, httpClient, pk.String())
dmsgC, closeDmsg, err := dmsgclient.InitDmsgWithFlags(ctx, dlog, pk, sk, httpClient, pk.String())
if err != nil {
dlog.WithError(err).Error("Error connecting to dmsg network")
return
Expand Down Expand Up @@ -186,7 +180,5 @@ Default mode of operation is dmsghttp:

// Execute executes root CLI command.
func Execute() {
if err := RootCmd.Execute(); err != nil {
log.Fatal("Failed to execute command: ", err)
}
dmsgclient.Execute(RootCmd)
}
Loading
Loading