server

package
v0.0.0-...-b34e599 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Address for the HTTP server to listen on.
	HTTPAddr string `yaml:"http_addr"`
	// Address for the gRPC server to listen on.
	GRPCAddr string `yaml:"grpc_addr"`
	// Address for the HTTP server for exporting metrics
	MetricsAddr string `yaml:"metrics_addr"`
}

Config represents the configuration of the Server.

func (*Config) Default

func (m *Config) Default()

Default sets the default values for the configuration.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is used to handle requests for various management operations with Monalive, such as checking the current configuration status and reloading it.

func New

func New(config *Config, metrics map[metrics.Scope]metrics.Gatherer, manager monalivepb.MonaliveManagerServer, logger *log.Logger) *Server

New creates a new Server instance with the given configuration and gRPC manager. It initializes both gRPC and HTTP servers and registers necessary services.

func (*Server) Run

func (m *Server) Run(ctx context.Context) error

Run starts both the gRPC and HTTP servers.

func (*Server) Stop

func (m *Server) Stop()

Stop gracefully stops both the gRPC and HTTP servers.

Jump to

Keyboard shortcuts

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