Documentation
¶
Overview ¶
Package server is a simple GRPC service performing useless memory allocations. Consider it as en example of MemLimiter integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MemLimiter *memlimiter.Config `json:"memLimiter"` //nolint:tagliatelle
Tracker *tracker.Config `json:"tracker"`
ListenEndpoint string `json:"listen_endpoint"`
}
Config - a top-level service configuration.
type Server ¶
type Server interface {
schema.AllocatorServer
// Run starts service (a blocking call).
Run() error
// Quit terminates service gracefully.
Quit()
// GRPCServer returns underlying server implementation. Only for testing purposes.
GRPCServer() *grpc.Server
// MemLimiter returns underlying memlimiter implementation. Only for testing purposes.
MemLimiter() memlimiter.Service
}
Server represents Allocator service interface.
func NewAllocatorServer ¶
func NewAllocatorServer(logger logr.Logger, cfg *Config, options ...grpc.ServerOption) (Server, error)
NewAllocatorServer - server constructor.
Click to show internal directories.
Click to hide internal directories.