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
Click to show internal directories.
Click to hide internal directories.