grpcserver

package
v0.1.0-preview.7 Latest Latest
Warning

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

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

Documentation

Overview

Package grpcserver implements the authenticated local gRPC process boundary without adding transport dependencies to the daemon lifecycle core.

Index

Constants

View Source
const (
	// AuthenticationMetadataKey is the standard gRPC metadata key carrying the
	// user-local daemon bearer credential.
	AuthenticationMetadataKey = "authorization"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointToken

type EndpointToken = endpoint.Token

EndpointToken is retained as a source-compatible alias for the shared transport-neutral endpoint credential.

func GenerateEndpointToken

func GenerateEndpointToken() (EndpointToken, error)

GenerateEndpointToken creates a credential from the operating-system CSPRNG.

func ParseEndpointToken

func ParseEndpointToken(encoded string) (EndpointToken, error)

ParseEndpointToken decodes the canonical unpadded base64url credential form.

type Server

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

Server is one authenticated local gRPC boundary. It wraps gRPC so callers cannot register the engine service without both authentication interceptors.

func NewServer

func NewServer(config ServerConfig) (*Server, error)

NewServer constructs the authenticated boundary without opening an OS listener. Generated applications remain responsible for endpoint ownership.

func (*Server) GracefulStop

func (server *Server) GracefulStop()

GracefulStop stops admission and waits without a deadline. New code should use Shutdown with an explicit deadline so a flow-control-blocked client cannot make process shutdown unbounded.

func (*Server) Serve

func (server *Server) Serve(listener net.Listener) error

Serve accepts authenticated connections from the caller-owned listener.

func (*Server) Shutdown

func (server *Server) Shutdown(ctx context.Context) error

Shutdown stops admission, cancels adapter-owned stream observations, and waits for accepted RPCs. If ctx ends first, it force-stops gRPC so a client blocked by transport flow control cannot strand process shutdown.

func (*Server) Stop

func (server *Server) Stop()

Stop immediately stops gRPC work and closes negotiated-session lookup. It does not close the transport-independent RunHost or SessionStore.

type ServerConfig

type ServerConfig struct {
	Root            context.Context //nolint:containedctx // transferred as the server service lifetime.
	EndpointToken   EndpointToken
	Host            *daemon.RunHost
	Sessions        *daemon.SessionStore
	Build           client.Build
	Capabilities    []string
	MaximumSessions int
}

ServerConfig contains the generated daemon dependencies and immutable public build facts for one local engine server. The server opens no listener and does not own Host or Sessions.

Jump to

Keyboard shortcuts

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