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 ¶
- type Handler
- func (h *Handler) Contest(ctx context.Context, req *pb.ContestRequest) (*pb.ContestResponse, error)
- func (h *Handler) Fork(ctx context.Context, req *pb.ForkRequest) (*pb.MemoryRecordResponse, error)
- func (h *Handler) GetMetrics(ctx context.Context, _ *pb.GetMetricsRequest) (*pb.MetricsResponse, error)
- func (h *Handler) IngestEvent(ctx context.Context, req *pb.IngestEventRequest) (*pb.IngestResponse, error)
- func (h *Handler) IngestObservation(ctx context.Context, req *pb.IngestObservationRequest) (*pb.IngestResponse, error)
- func (h *Handler) IngestOutcome(ctx context.Context, req *pb.IngestOutcomeRequest) (*pb.IngestResponse, error)
- func (h *Handler) IngestToolOutput(ctx context.Context, req *pb.IngestToolOutputRequest) (*pb.IngestResponse, error)
- func (h *Handler) IngestWorkingState(ctx context.Context, req *pb.IngestWorkingStateRequest) (*pb.IngestResponse, error)
- func (h *Handler) Merge(ctx context.Context, req *pb.MergeRequest) (*pb.MemoryRecordResponse, error)
- func (h *Handler) Penalize(ctx context.Context, req *pb.PenalizeRequest) (*pb.PenalizeResponse, error)
- func (h *Handler) Reinforce(ctx context.Context, req *pb.ReinforceRequest) (*pb.ReinforceResponse, error)
- func (h *Handler) Retract(ctx context.Context, req *pb.RetractRequest) (*pb.RetractResponse, error)
- func (h *Handler) Retrieve(ctx context.Context, req *pb.RetrieveRequest) (*pb.RetrieveResponse, error)
- func (h *Handler) RetrieveByID(ctx context.Context, req *pb.RetrieveByIDRequest) (*pb.MemoryRecordResponse, error)
- func (h *Handler) Supersede(ctx context.Context, req *pb.SupersedeRequest) (*pb.MemoryRecordResponse, error)
- type Server
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 ¶
func (h *Handler) Fork(ctx context.Context, req *pb.ForkRequest) (*pb.MemoryRecordResponse, error)
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 ¶
func (h *Handler) Merge(ctx context.Context, req *pb.MergeRequest) (*pb.MemoryRecordResponse, error)
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 ¶
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 ¶
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.