server

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package server manages access to a resource

Index

Constants

This section is empty.

Variables

View Source
var (

	// RefreshCounts tracks the number of times Refresh are called for a server.
	RefreshCounts = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "visus_refresh_counts",
			Help: "number of times refresh was executed",
		},
		labels,
	)
	// RefreshErrors tracks the number of times Refresh failed for a server.
	RefreshErrors = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "visus_refresh_errors",
			Help: "number of times refresh failed",
		},
		labels,
	)
)

Common server metrics.

Functions

func RegisterMetrics added in v0.3.0

func RegisterMetrics(registry *prometheus.Registry) error

RegisterMetrics register the server metrics to the named Prometheus registry.

Types

type Config

type Config struct {
	BindAddr          string        // Address to bind the server to.
	BindCert, BindKey string        // Paths to Certificate and Key.
	CaCert            string        // Path to the Root CA.
	Endpoint          string        // Endpoint for metrics
	Inotify           bool          // Enable inotify for scans.
	Insecure          bool          // Sanity check to ensure that the operator really means it.
	ProcMetrics       bool          // Enable collections of process metrics.
	Prometheus        string        // URL for the node prometheus endpoint
	Refresh           time.Duration // how often to refresh the configuration.
	RewriteHistograms bool          // Enable histogram rewriting
	URL               string        // URL to connect to the database
	VisusMetrics      bool          // Enable collection of Visus metrics.
}

Config encapsulates the command-line parameters that can be supplied to configure the behavior of Visus.

type Server

type Server interface {
	Start(ctx *stopper.Context) error
	Refresh(ctx *stopper.Context) error
}

The Server interface manages the lifecycle of a process that controls access to a resource. Its configuration can be refreshed. It uses the stopper interface to manage graceful shutdown.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL