grpc_server

package
v0.0.0-...-4e32e44 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemHandler

type ItemHandler struct {
	api.UnimplementedOrderServiceServer
	// contains filtered or unexported fields
}

func NewItemHandler

func NewItemHandler(s interfaces.OrderService) *ItemHandler

func (*ItemHandler) CancelOrder

func (*ItemHandler) CompleteOrder

func (*ItemHandler) CreateOrder

func (*ItemHandler) DeleteOrder

func (*ItemHandler) GetOrder

func (*ItemHandler) ListOrders

func (*ItemHandler) SearchOrders

func (*ItemHandler) UpdateOrder

type Option

type Option func(*Server)

func WithAddr

func WithAddr(addr string) Option

func WithCircuitBreakerSettings

func WithCircuitBreakerSettings(maxRequests uint32, interval, timeout time.Duration) Option

func WithProfiling

func WithProfiling() Option

func WithRateLimiter

func WithRateLimiter(limit, burst int) Option

type Server

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

func MustNew

func MustNew(log logger.Logger, handler api.OrderServiceServer, opts ...Option) *Server

func (*Server) GracefulStop

func (s *Server) GracefulStop()

func (*Server) Run

func (s *Server) Run() error

Run starts grpc server using cmux.

Handles all HTTP2 requests with 'content-type: application/grpc' headers with grpc server Other paths are hardcoded (for now at least).

Hardcoded ones are: <addr>/metrics. And if profiling is enabled: <addr>/debug/pprof{/,/cmdline,/profile,/symbol,/trace}.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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