server

package
v1.0.28 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxConcurrentConn = 1024
	DefaultWindowSize        = 16 * 1024 * 1024
	DefaultKeepaliveTime     = 20 * time.Second
	DefaultKeepaliveTimeout  = 5 * time.Second
	DefaultMinKeepaliveTime  = 5 * time.Second

	MonitoringInterval     = 30 * time.Second
	CleanupInterval        = 120 * time.Second
	CacheRefCountThreshold = 500

	ShutdownTimeout = 30 * time.Second

	RedisDialTimeout  = 5 * time.Second
	RedisReadTimeout  = 3 * time.Second
	RedisWriteTimeout = 3 * time.Second
	RedisPoolSize     = 10
	RedisMinIdleConns = 3
)

Default constants for gRPC server

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceName    string
	ServiceVersion string
	Environment    string
	Port           int
	OtelEndpoint   string
}

Config defines the common configuration for all gRPC services

type GRPCServer

type GRPCServer struct {
	Logger           logger.LoggerInterface
	DB               *db.Queries
	Ctx              context.Context
	Cancel           context.CancelFunc
	CacheStore       *cache.CacheStore
	Redis            *redis.Client
	Telemetry        *otel_pkg.Telemetry
	Config           *Config
	RegisterServices func(*grpc.Server)
}

func New

func New(cfg *Config) (*GRPCServer, error)

func (*GRPCServer) Cleanup

func (s *GRPCServer) Cleanup()

func (*GRPCServer) Run

func (s *GRPCServer) Run() error

Jump to

Keyboard shortcuts

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