Commit Graph

19 Commits

Author SHA1 Message Date
Kwitsch debac9eaa8
Refactoring/linter (#1447)
* update golangci-lint to v1.57.2

* linter fixes
2024-04-12 16:44:50 -04:00
ThinkChaos bcd1381e18 feat: update list config and code to use "allow/deny" language 2024-04-11 18:33:09 -04:00
Kwitsch 03131c443c
Refactoring/config struct names (#1315)
* vscode config changed in new version

* FilteringConfig -> Filtering

* CachingConfig -> Caching

* QueryLogConfig -> QueryLog

* MetricsConfig -> Metrics

* HostsFileConfig -> HostsFile

* PortsConfig -> Ports

* BootstrapDNSConfig -> BootstrapDNS

* BootstrappedUpstreamConfig -> BootstrappedUpstream

* bootstrapDNSConfig -> bootstrapDNS

* bootstrappedUpstreamConfig -> bootstrappedUpstream

* SourceLoadingConfig -> SourceLoading

* DownloaderConfig -> Downloader
2023-12-20 15:38:33 -05:00
ThinkChaos 5088c75a78
refactor: configuration rework (usage and printing) (#920)
* refactor: make `config.Duration` a struct with `time.Duration` embed

Allows directly calling `time.Duration` methods.

* refactor(HostsFileResolver): don't copy individual config items

The idea is to make adding configuration options easier, and searching
for references straight forward.

* refactor: move config printing to struct and use a logger

Using a logger allows using multiple levels so the whole configuration
can be printed in trace/verbose mode, but only important parts are
shown by default.

* squash: rename `Cast` to `ToDuration`

* squash: revert `Duration` to a simple wrapper ("new type" pattern)

* squash: `Duration.IsZero` tests

* squash: refactor resolvers to rely on their config directly if possible

* squash: implement `IsEnabled` and `LogValues` for all resolvers

* refactor: use go-enum `--values` to simplify getting all log fields

* refactor: simplify `QType` unmarshaling

* squash: rename `ValueLogger` to `Configurable`

* squash: rename `UpstreamConfig` to `ParallelBestConfig`

* squash: rename `RewriteConfig` to `RewriterConfig`

* squash: config tests

* squash: resolver tests

* squash: add `ForEach` test and improve `Chain` ones

* squash: simplify implementing `config.Configurable`

* squash: minor changes for better coverage

* squash: more `UnmarshalYAML` -> `UnmarshalText`

* refactor: move `config.Upstream` into own file

* refactor: add `Resolver.Type` method

* squash: add `log` method to `typed` to use `Resolover.Type` as prefix

* squash: tweak startup config logging

* squash: add `LogResolverConfig` tests

* squash: make sure all options of type `Duration` use `%s`
2023-03-12 22:14:10 +01:00
Kwitsch 9abeaeddea
Added gofumpt (#805)
* fix linter errors

* added gofumpt

* Makefile cleanup

* gofumpt run

* Update Makefile

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>

* go mod tidy

* fmt + lint

* go mod tidy

Co-authored-by: ThinkChaos <ThinkChaos@users.noreply.github.com>
2022-12-26 22:11:45 +01:00
Dimitri Herzog f78a57a94d
chore(build): add additional linters (#774)
* chore(build): add nolintlint linter

* chore(build): add usestdlibvars linter
2022-11-29 21:58:26 +01:00
FileGo 926f06ccdb
Add failed_download_count prometheus metric (#309) (#395)
Prometheus metric "failed_download_count" for failed downloads
2022-01-04 21:24:49 +01:00
Dimitri Herzog 7ea5ba4cac updated github.com/go-chi/chi 2021-12-24 23:04:47 +01:00
Dimitri Herzog ee8f041938 refactoring: generate enums 2021-09-11 21:31:03 +02:00
Dimitri Herzog 919512959b use full-qualified name as module 2021-08-27 13:41:36 +02:00
Dimitri Herzog 93d3c92d9a fixed golangci-lint warnings 2021-06-16 22:30:52 +02:00
moyo 9ea8419175
Add prefetch hit metrics (#190)
* add prefetch hit metrics

* add tests for prefetch hit
2021-04-24 21:48:08 +02:00
donald-art 7ee2e7db64
public API documentation (#146)
* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments

* added doc comments
2021-02-26 13:45:57 +01:00
Dimitri Herzog 54c2ad870d added last list group refresh timestamp metric 2021-01-23 22:29:43 +01:00
Dimitri Herzog e94505557e added build info metric 2021-01-23 22:29:43 +01:00
Dimitri Herzog 0fd25207d1 introducing event bus, refactorings 2021-01-23 22:29:43 +01:00
Dimitri Herzog 3bd80242e8
DoH server support (#61)
#17: DoH server support
2020-05-23 22:54:51 +02:00
Dimitri Herzog 0766c6480a #27: CLI tool 2020-04-08 23:03:07 +02:00
Dimitri Herzog 673e208cdd fixes # 18: add additional prometheus metrics for dashboard 2020-03-06 23:00:14 +01:00