aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/silent-ctmoon/main.go2
-rw-r--r--cmd/silent-ctnode/main.go2
-rw-r--r--internal/feedback/feedback.go6
-rw-r--r--internal/logger/logger.go5
-rw-r--r--internal/manager/manager.go8
-rw-r--r--internal/monitor/monitor.go12
-rw-r--r--pkg/policy/wildcard.go2
7 files changed, 19 insertions, 18 deletions
diff --git a/cmd/silent-ctmoon/main.go b/cmd/silent-ctmoon/main.go
index 0557621..c651e68 100644
--- a/cmd/silent-ctmoon/main.go
+++ b/cmd/silent-ctmoon/main.go
@@ -60,7 +60,7 @@ type config struct {
numWorkers uint
// Extracted
- log logger.Logger
+ log *logger.Logger
policy policy.Policy
}
diff --git a/cmd/silent-ctnode/main.go b/cmd/silent-ctnode/main.go
index fec088c..99f4437 100644
--- a/cmd/silent-ctnode/main.go
+++ b/cmd/silent-ctnode/main.go
@@ -44,7 +44,7 @@ type config struct {
output string
// Extracted
- log logger.Logger
+ log *logger.Logger
files []string
}
diff --git a/internal/feedback/feedback.go b/internal/feedback/feedback.go
index 77431e0..7501bbf 100644
--- a/internal/feedback/feedback.go
+++ b/internal/feedback/feedback.go
@@ -23,9 +23,9 @@ type Config struct {
Policy policy.Policy
// Optional
- Logger logger.Logger // Debug and info prints only (no output by default)
- PullInterval time.Duration // How often nodes are pulled via HTTP GET
- HTTPTimeout time.Duration // Timeout to use when pulling nodes
+ Logger *logger.Logger // Debug and info prints only (no output by default)
+ PullInterval time.Duration // How often nodes are pulled via HTTP GET
+ HTTPTimeout time.Duration // Timeout to use when pulling nodes
}
type Feedback struct {
diff --git a/internal/logger/logger.go b/internal/logger/logger.go
index 195ad3e..96f9f22 100644
--- a/internal/logger/logger.go
+++ b/internal/logger/logger.go
@@ -56,9 +56,10 @@ type Logger struct {
mutex sync.Mutex
}
-func New(cfg Config) (l Logger) {
+func New(cfg Config) *Logger {
+ l := Logger{}
l.Reconfigure(cfg)
- return
+ return &l
}
func (l *Logger) Reconfigure(cfg Config) {
diff --git a/internal/manager/manager.go b/internal/manager/manager.go
index ba7f1d0..bf1ad92 100644
--- a/internal/manager/manager.go
+++ b/internal/manager/manager.go
@@ -21,10 +21,10 @@ type Config struct {
Directory string // Path to a directory where everything will be stored
// Optional
- Logger logger.Logger // Where to output messages and with what verbosity
- AlertDelay time.Duration // Time before alerting on certificates that are unaccounted for
- MetadataRefreshInterval time.Duration // How often to update the list of monitored logs
- ShutdownTimeout time.Duration // Force shutdown after this timeout (FIXME: should not be needed)
+ Logger *logger.Logger // Where to output messages and with what verbosity
+ AlertDelay time.Duration // Time before alerting on certificates that are unaccounted for
+ MetadataRefreshInterval time.Duration // How often to update the list of monitored logs
+ ShutdownTimeout time.Duration // Force shutdown after this timeout (FIXME: should not be needed)
}
type Manager struct {
diff --git a/internal/monitor/monitor.go b/internal/monitor/monitor.go
index 121d853..12d93cf 100644
--- a/internal/monitor/monitor.go
+++ b/internal/monitor/monitor.go
@@ -61,12 +61,12 @@ type LogEntry struct {
type Config struct {
// Optional
- Matcher Matcher // Which log entries to match (default is to match all)
- Logger logger.Logger // Debug prints only (no output by default)
- Contact string // Something that help log operators get in touch
- ChunkSize uint // Min number of leaves to propagate a chunk without matches
- BatchSize uint // Max number of certificates to accept per worker
- NumWorkers uint // Number of parallel workers to use for each log
+ Matcher Matcher // Which log entries to match (default is to match all)
+ Logger *logger.Logger // Debug prints only (no output by default)
+ Contact string // Something that help log operators get in touch
+ ChunkSize uint // Min number of leaves to propagate a chunk without matches
+ BatchSize uint // Max number of certificates to accept per worker
+ NumWorkers uint // Number of parallel workers to use for each log
}
type Monitor struct {
diff --git a/pkg/policy/wildcard.go b/pkg/policy/wildcard.go
index 58b0d17..abea841 100644
--- a/pkg/policy/wildcard.go
+++ b/pkg/policy/wildcard.go
@@ -39,7 +39,7 @@ func (w *Wildcards) match(sans []string, notAfter time.Time) bool {
type Wildcard struct {
BootstrapAt time.Time `json:"bootstrap_at"`
Wildcard string `json:"wildcard"`
- Excludes []string `json:"excludes",omitempty"`
+ Excludes []string `json:"excludes,omitempty"`
}
func (w *Wildcard) UnmarshalJSON(data []byte) error {