Skip to content

Commit

Permalink
Restructure remaining packages
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Apr 24, 2022
1 parent 9e797f5 commit 2c401ba
Show file tree
Hide file tree
Showing 33 changed files with 23 additions and 20 deletions.
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ import (
"sync"
"syscall"

"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/discovery"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/metrics"
"github.com/martin-helmich/prometheus-nginxlog-exporter/syslog"

"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/discovery"
"github.com/martin-helmich/prometheus-nginxlog-exporter/parser"
"github.com/martin-helmich/prometheus-nginxlog-exporter/prof"
"github.com/martin-helmich/prometheus-nginxlog-exporter/relabeling"
"github.com/martin-helmich/prometheus-nginxlog-exporter/tail"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/parser"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/prof"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/relabeling"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/syslog"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/tail"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion config/loader_hcl.go → pkg/config/loader_hcl.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package config

import (
"github.com/hashicorp/hcl"
"io"
"io/ioutil"

"github.com/hashicorp/hcl"
)

func loadConfigFromHCLStream(config *Config, file io.Reader) error {
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion config/loader_yaml.go → pkg/config/loader_yaml.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package config

import (
"gopkg.in/yaml.v2"
"io"
"io/ioutil"

"gopkg.in/yaml.v2"
)

func loadConfigFromYAMLStream(config *Config, file io.Reader) error {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion discovery/consul.go → pkg/discovery/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package discovery

import (
"github.com/hashicorp/consul/api"
"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"
)

// ConsulRegistrator is a helper struct that handles Consul service registration
Expand Down
4 changes: 2 additions & 2 deletions pkg/metrics/collection_init.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package metrics

import (
"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/relabeling"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/relabeling"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/namespace.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package metrics

import (
"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions parser/parser.go → pkg/parser/parser.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package parser

import (
"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/parser/jsonparser"
"github.com/martin-helmich/prometheus-nginxlog-exporter/parser/textparser"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/parser/jsonparser"
"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/parser/textparser"
)

// Parser parses a line of log to a map[string]string.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion relabeling/defaults.go → pkg/relabeling/defaults.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package relabeling

import "github.com/martin-helmich/prometheus-nginxlog-exporter/config"
import "github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"

// DefaultRelabelings are hardcoded relabeling configs that are always there
// and do not need to be explicitly configured
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package relabeling

import (
"github.com/martin-helmich/prometheus-nginxlog-exporter/config"
"testing"

"github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"
)

func buildRelabeling(cfg config.RelabelConfig) (*Relabeling, error) {
Expand Down
2 changes: 1 addition & 1 deletion relabeling/types.go → pkg/relabeling/types.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package relabeling

import "github.com/martin-helmich/prometheus-nginxlog-exporter/config"
import "github.com/martin-helmich/prometheus-nginxlog-exporter/pkg/config"

// Relabeling contains a relabeling configuration and is responsible for
// executing the rules specified in the original configuration
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2c401ba

Please sign in to comment.