grpcserver

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package grpcserver provides the app.module.grpcserver app module: a long-running gRPC server that hosts service modules registered through its services: config block. The Service interface is exported here so that service modules can satisfy it without importing google.golang.org/grpc from the top-level sessionmanager package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

type Module struct {
	Mod      string               `yaml:"module"`
	Services []*config.ServiceCfg `yaml:"services"`
	// contains filtered or unexported fields
}

Module is the gRPC server app. Its lifecycle:

- Provision: resolve every service module listed under services: the services are provisioned before this app by the loader's topological order (the app depends on its services), so they are looked up by ID rather than loaded here; collect them in declaration order.

- Start: build the underlying *grpc.Server via commongrpc.NewServer using the top-level cfg.GRPC block, register every collected service onto it, listen on cfg.GRPC.Address, and begin Serve in a goroutine.

- Stop: GracefulStop bounded by cfg.GRPC.ShutdownTimeout; if the timeout fires, fall back to a forceful Stop.

func (*Module) Module

func (m *Module) Module() sessionmanager.ModuleInfo

func (*Module) Provision

func (m *Module) Provision(ctx *sessionmanager.Context) error

func (*Module) Start

func (m *Module) Start() error

func (*Module) Stop

func (m *Module) Stop() error

type Service

type Service interface {
	Register(s grpc.ServiceRegistrar)
}

Service is the interface that every gRPC service module loaded under an app.module.grpcserver entry must satisfy. The grpc app calls Register on each child service, in declaration order, before invoking Serve.

Jump to

Keyboard shortcuts

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