grpc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package grpc provides the gRPC transport layer for the Membrane service. It registers the protoc-generated service descriptor and delegates every RPC to the pkg/membrane API surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	pb.UnimplementedMembraneServiceServer
	// contains filtered or unexported fields
}

Handler implements the MembraneServiceServer interface by delegating to the Membrane API.

func (*Handler) Contest

func (h *Handler) Contest(ctx context.Context, req *pb.ContestRequest) (*pb.ContestResponse, error)

Contest converts the gRPC request and delegates to Membrane.Contest.

func (*Handler) Fork

Fork converts the gRPC request and delegates to Membrane.Fork.

func (*Handler) GetMetrics

func (h *Handler) GetMetrics(ctx context.Context, _ *pb.GetMetricsRequest) (*pb.MetricsResponse, error)

GetMetrics delegates to Membrane.GetMetrics and returns a JSON-encoded snapshot.

func (*Handler) IngestEvent

func (h *Handler) IngestEvent(ctx context.Context, req *pb.IngestEventRequest) (*pb.IngestResponse, error)

IngestEvent converts the gRPC request and delegates to Membrane.IngestEvent.

func (*Handler) IngestObservation

func (h *Handler) IngestObservation(ctx context.Context, req *pb.IngestObservationRequest) (*pb.IngestResponse, error)

IngestObservation converts the gRPC request and delegates to Membrane.IngestObservation.

func (*Handler) IngestOutcome

func (h *Handler) IngestOutcome(ctx context.Context, req *pb.IngestOutcomeRequest) (*pb.IngestResponse, error)

IngestOutcome converts the gRPC request and delegates to Membrane.IngestOutcome.

func (*Handler) IngestToolOutput

func (h *Handler) IngestToolOutput(ctx context.Context, req *pb.IngestToolOutputRequest) (*pb.IngestResponse, error)

IngestToolOutput converts the gRPC request and delegates to Membrane.IngestToolOutput.

func (*Handler) IngestWorkingState

func (h *Handler) IngestWorkingState(ctx context.Context, req *pb.IngestWorkingStateRequest) (*pb.IngestResponse, error)

IngestWorkingState converts the gRPC request and delegates to Membrane.IngestWorkingState.

func (*Handler) Merge

Merge converts the gRPC request and delegates to Membrane.Merge.

func (*Handler) Penalize

func (h *Handler) Penalize(ctx context.Context, req *pb.PenalizeRequest) (*pb.PenalizeResponse, error)

Penalize converts the gRPC request and delegates to Membrane.Penalize.

func (*Handler) Reinforce

func (h *Handler) Reinforce(ctx context.Context, req *pb.ReinforceRequest) (*pb.ReinforceResponse, error)

Reinforce converts the gRPC request and delegates to Membrane.Reinforce.

func (*Handler) Retract

func (h *Handler) Retract(ctx context.Context, req *pb.RetractRequest) (*pb.RetractResponse, error)

Retract converts the gRPC request and delegates to Membrane.Retract.

func (*Handler) Retrieve

func (h *Handler) Retrieve(ctx context.Context, req *pb.RetrieveRequest) (*pb.RetrieveResponse, error)

Retrieve converts the gRPC request and delegates to Membrane.Retrieve.

func (*Handler) RetrieveByID

func (h *Handler) RetrieveByID(ctx context.Context, req *pb.RetrieveByIDRequest) (*pb.MemoryRecordResponse, error)

RetrieveByID converts the gRPC request and delegates to Membrane.RetrieveByID.

func (*Handler) Supersede

func (h *Handler) Supersede(ctx context.Context, req *pb.SupersedeRequest) (*pb.MemoryRecordResponse, error)

Supersede converts the gRPC request and delegates to Membrane.Supersede.

type Server

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

Server wraps a gRPC server wired to a Membrane instance.

func NewServer

func NewServer(m *membrane.Membrane, cfg *membrane.Config) (*Server, error)

NewServer creates a Server that will listen on the configured address and serve RPCs backed by the given Membrane instance. It configures TLS, authentication, and rate limiting based on the provided config.

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the network address the server is listening on. This is useful in tests where ":0" is passed to let the OS pick a free port.

func (*Server) Start

func (s *Server) Start() error

Start serves gRPC requests. It blocks until Stop is called or an unrecoverable error occurs.

func (*Server) Stop

func (s *Server) Stop()

Stop performs a graceful shutdown of the gRPC server, finishing in-flight RPCs before returning.

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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