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
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ issues:
max-issues-per-linter: 0
max-same-issues: 0
linters:
disable:
- depguard
enable:
- errcheck
- gosimple
Expand All @@ -12,9 +14,15 @@ linters:
- staticcheck
- unused
# Defaults above ours below
- copyloopvar
- usestdlibvars
- whitespace
presets:
- bugs
- format
- import
- performance
- unused
#linters-settings:
# errcheck:
# check-type-assertions: true
Expand Down
10 changes: 4 additions & 6 deletions cmd/cdnsd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ import (
"fmt"
"log/slog"
"net/http"
"os"
"time"

// #nosec G108
_ "net/http/pprof"

"github.com/prometheus/client_golang/prometheus/promhttp"
"go.uber.org/automaxprocs/maxprocs"
"os"
"time"

"github.com/blinklabs-io/cdnsd/internal/config"
"github.com/blinklabs-io/cdnsd/internal/dns"
"github.com/blinklabs-io/cdnsd/internal/indexer"
"github.com/blinklabs-io/cdnsd/internal/logging"
"github.com/blinklabs-io/cdnsd/internal/state"
"github.com/blinklabs-io/cdnsd/internal/version"
"github.com/prometheus/client_golang/prometheus/promhttp"
"go.uber.org/automaxprocs/maxprocs"
)

var cmdlineFlags struct {
Expand Down
11 changes: 4 additions & 7 deletions internal/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@ import (

"github.com/blinklabs-io/cdnsd/internal/config"
"github.com/blinklabs-io/cdnsd/internal/state"

"github.com/miekg/dns"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)

var (
metricQueryTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "dns_query_total",
Help: "total DNS queries handled",
})
)
var metricQueryTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "dns_query_total",
Help: "total DNS queries handled",
})

func Start() error {
cfg := config.GetConfig()
Expand Down
13 changes: 6 additions & 7 deletions internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ import (
"strings"
"time"

"github.com/blinklabs-io/cdnsd/internal/config"
"github.com/blinklabs-io/cdnsd/internal/logging"
"github.com/blinklabs-io/cdnsd/internal/state"
ouroboros "github.com/blinklabs-io/gouroboros"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

"github.com/blinklabs-io/adder/event"
filter_event "github.com/blinklabs-io/adder/filter/event"
input_chainsync "github.com/blinklabs-io/adder/input/chainsync"
output_embedded "github.com/blinklabs-io/adder/output/embedded"
"github.com/blinklabs-io/adder/pipeline"
models "github.com/blinklabs-io/cardano-models"
"github.com/blinklabs-io/cdnsd/internal/config"
"github.com/blinklabs-io/cdnsd/internal/logging"
"github.com/blinklabs-io/cdnsd/internal/state"
ouroboros "github.com/blinklabs-io/gouroboros"
"github.com/blinklabs-io/gouroboros/cbor"
"github.com/blinklabs-io/gouroboros/ledger"
ocommon "github.com/blinklabs-io/gouroboros/protocol/common"
"github.com/miekg/dns"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)

const (
Expand Down
1 change: 0 additions & 1 deletion internal/logging/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func Configure() {
Level: level,
})
globalLogger = slog.New(handler).With("component", "main")

}

func GetLogger() *slog.Logger {
Expand Down
6 changes: 4 additions & 2 deletions internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import (
)

// These are populated at build time
var Version string
var CommitHash string
var (
Version string
CommitHash string
)

func GetVersionString() string {
if Version != "" {
Expand Down