srvgrpc

package module
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config[T GRPCRegistrar] struct {
	Label common.Label
	Host  common.Host
	Port  common.Port
}

Config is the gRPC server spec (Label, Host, Port); ecfg fills before Build.

func (*Config[T]) Build

func (cfg *Config[T]) Build() (any, error)

type GRPCMetrics

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

GRPCMetrics is a singleton pool resource: contributor + shared prometheus interceptors for all srv-grpc servers.

func (*GRPCMetrics) InitializeMetrics

func (m *GRPCMetrics) InitializeMetrics(s *grpc.Server)

func (*GRPCMetrics) RegisterMetrics

func (m *GRPCMetrics) RegisterMetrics(reg *prom.Registry) error

func (*GRPCMetrics) StreamServerInterceptor

func (m *GRPCMetrics) StreamServerInterceptor() grpc.StreamServerInterceptor

func (*GRPCMetrics) UnaryServerInterceptor

func (m *GRPCMetrics) UnaryServerInterceptor() grpc.UnaryServerInterceptor

type GRPCRegistrar

type GRPCRegistrar interface {
	RegisterGRPC(*grpc.Server)
}

GRPCRegistrar registers service implementations on a gRPC server.

type MetricsContributor

type MetricsContributor interface {
	RegisterMetrics(reg *prom.Registry) error
}

MetricsContributor registers gRPC metrics collectors into a shared registry. Same method signature as github.com/omcrgnt/ops/metrics.MetricsContributor.

type Server

type Server[T GRPCRegistrar] struct {
	// contains filtered or unexported fields
}

Server is the gRPC server resource bound to handler type T. Catalog field: *Server[T] (Configurable); materialized *Server[T] is the runtime instance after Config.Build. Runtime methods: Start, Close, HealthCheck, ProbeReady.

func (*Server[T]) BuildConfig

func (*Server[T]) BuildConfig() (app.Materializer, error)

func (*Server[T]) Close

func (t *Server[T]) Close(ctx context.Context) error

func (*Server[T]) Deps

func (r *Server[T]) Deps() []any

func (*Server[T]) HealthCheck

func (t *Server[T]) HealthCheck(_ context.Context) error

func (*Server[T]) Inject

func (r *Server[T]) Inject(args []any)

func (*Server[T]) ProbeReady

func (t *Server[T]) ProbeReady(ctx context.Context) error

ProbeReady reports traffic readiness (SDI duck typing; no ops import). v1: same as HealthCheck — non-nil if Serve failed after Start.

func (*Server[T]) Start

func (t *Server[T]) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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