Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 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.0.1

func RegisterMetrics(registry *prometheus.Registry) error

RegisterMetrics register the server metrics to the named Prometheus registry.

Types

type Config

type Config struct {
	AllowUnsafeInternals bool          // Enable allow_unsafe_internals for database connections.
	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