Skip to content

Commit

Permalink
introspection: lints
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jul 24, 2024
1 parent dbcfe30 commit 1f226c7
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions introspection/server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package introspection holds the implementation details for the
// "introspection" HTTP server that Clair hosts.
package introspection

import (
Expand All @@ -22,18 +24,32 @@ import (
"github.com/quay/clair/v4/health"
)

// Valid backends for both metrics and traces.
const (
Prom = "prometheus"
DefaultPromEndpoint = "/metrics"
Stdout = "stdout"
Jaeger = "jaeger"
HealthEndpoint = "/healthz"
ReadyEndpoint = "/readyz"
DefaultIntrospectionAddr = ":8089"
Stdout = "stdout"
)

// Server provides an http server
// exposing Clair metrics and traces
// Valid backends for metrics.
const (
Prom = "prometheus"
)

// Valid backends for traces.
const (
Jaeger = "jaeger"
)

// Endpoints on the introspection HTTP server.
const (
DefaultPromEndpoint = "/metrics"
HealthEndpoint = "/healthz"
ReadyEndpoint = "/readyz"
)

// DefaultIntrospectionAddr is the default address if not provided in the configuration.
const DefaultIntrospectionAddr = ":8089"

// Server provides an HTTP server exposing Clair metrics and debugging information.
type Server struct {
// configuration provided when starting Clair
conf *config.Config
Expand All @@ -46,6 +62,7 @@ type Server struct {
health func() bool
}

// New constructs a [*Server], which has an embedded [*http.Server].
func New(ctx context.Context, conf *config.Config, health func() bool) (*Server, error) {
ctx = zlog.ContextWithValues(ctx, "component", "introspection/New")

Expand Down

0 comments on commit 1f226c7

Please sign in to comment.