server

package
v0.0.0-...-445c557 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GracefulShutdown

func GracefulShutdown(srv *grpc.Server, cfg *config.Config)

GracefulShutdown listens for system interrupt signals (e.g., SIGINT, SIGTERM) and gracefully shuts down the gRPC server. This function ensures that the server stops accepting new connections and allows in-progress requests to complete before shutting down.

func InterceptorLogger

func InterceptorLogger(l zerolog.Logger) logging.Logger

InterceptorLogger creates a logging function compatible with the gRPC middleware's logging system, using zerolog as the underlying logger. It returns a logging.Logger that logs messages at the appropriate level (Debug, Info, Warn, Error) based on the gRPC logging level.

func New

func New(cfg *config.Config) *cacheServer

Creates and initializes a new cacheServer with the given configuration. It sets up the local cache, hash ring, connection pool, and memberlist, and adds the local node to the hash ring.

Types

This section is empty.

Jump to

Keyboard shortcuts

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